This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Parallel::ForkManager; | |
my $pm = Parallel::ForkManager->new(8); | |
for my $file (glob "/usr/local/backup/*") { | |
my $pid = $pm->start and next; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Benchmark qw(cmpthese); | |
qx(ls -1U); # Populate dir cache | |
cmpthese(1000, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.12.0; | |
use Getopt::Long; | |
use File::Next; | |
use PPI; | |
my ($match, $content) = qw(Element content); | |
my ($count, $verbose); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.12.0; | |
use File::Next; | |
use PPI; | |
my $basedir = shift // '.'; | |
my $elements = shift // 'Token::Regexp'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Plack::Builder; | |
my $access_log = ...; | |
builder { | |
open my $logfh, ">>", $access_log | |
or die "Couldn't open $access_log: $!"; | |
enable "AccessLog::Timed", | |
format => "%v %h %l %u %t \"%r\" %>s %b %D", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package PlackX::Util::Middelware; | |
use Plack::Util; | |
sub handle_response { | |
my ($res, %callback) = @_; | |
$callback{on_chunk} = sub { 1 }; | |
$callback{on_close} = sub { 1 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for commit in $( git log --format=format:%H ) ; do | |
git ls-tree -r $commit | while read line ; do | |
echo $commit $line | |
done | |
done | grep $( git hash-object $1 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
2011-07-28: Tilføjet RSS | |
2009-08-05: Helt nyt view og parfil. OBS parameter minister daekker over ministerArea | |
2009-04-18: PEP Rediget til optimering (udkommentering spørgsmåltyper) | |
2009-03-26: Redigeret til samrådsspm. | |
2009-03-19: SYNKRONISERET til alle servere | |
2008-05-11: denne configuration er OK PEP | |
2010-04-06: rettet sortering på nr. JOKR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH MT AS ( SELECT row_number() over ( ORDER BY CASE WHEN | |
ftcn_casenumber.ftcn_casetypedesc in ('B ', 'S ', 'L ', 'Aktstk.', 'US') THEN | |
UPPER(ftcn_casenumber.ftcn_casetypedesc + ' ' + REPLICATE('0', 50 - | |
len(ftcn_casenumber.ftcn_casenumber)) + ftcn_casenumber.ftcn_casenumber + ' ' + | |
IsNull(ftcn_casenumber.ftcn_casenosuffix, '') + ' ' + REPLICATE('0', 50 - | |
len(convert(varchar(10),IsNull(documentParagraphNumber,0)))) + | |
convert(varchar(10),IsNull(documentParagraphNumber,0))) ELSE ( CASE WHEN | |
caseTypeRecno=100012 then 'UM-DEL' WHEN caseTypeRecno=100001 THEN 'ALM. DEL ' + | |
committeeAbbreviation + ' ' + REPLICATE('0', 50 - | |
len(convert(varchar(10),IsNull(documentParagraphNumber,0)))) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Title: Modern Web Programming in Perl | |
Duration: 45 minutes | |
In year 1997 dynamic web pages often consisted of HTML forms you could | |
submit to the server and get a full HTML page back. The standard | |
language for writing the server code was Perl and it is quite probable | |
that the worst code ever written in any language is written in Perl | |
about 15 years ago to handle some HTML form processing. | |
Since then different languages has been hyped as *the* language for |