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; | |
do 'us_federal_holidays.pl'; | |
# Test cases extracted from <http://www.opm.gov/Operating_Status_Schedules/fedhol/Index.asp> | |
my @tests = ( | |
[ 1997, '1997-01-01', '1997-01-20', '1997-02-17', '1997-05-26', '1997-07-04', | |
'1997-09-01', '1997-10-13', '1997-11-11', '1997-11-27', '1997-12-25' ], |
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 Encode qw[find_encoding]; | |
use Unicode::UTF8 qw[decode_utf8]; | |
{ | |
my $encoding = find_encoding('Windows-1252') | |
or die q/Couldn't find Windows-1252 encoding/; |
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 HTTP::Response; | |
my $response = HTTP::Response->new( | |
200, 'OK', [ 'Content-Type' => 'multipart/form-data' ] | |
); |
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 CGI::Fast qw[]; | |
use FCGI qw[]; | |
use IO::Socket::INET qw[]; | |
use Net::FastCGI::Constant qw[:common :type :role]; | |
use Net::FastCGI::IO qw[ read_record |
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
/opt/perl/5.13.11/bin/perl packed_vs_hash.pl | |
Benchmarking constructor | |
Rate hash pack | |
hash 445987/s -- -10% | |
pack 496264/s 11% -- | |
Benchmarking accessor | |
Rate vec hash | |
vec 1190203/s -- -9% | |
hash 1308227/s 10% -- |
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 Carp qw[]; | |
my $WS = '[\x20\x09\x0A\x0D]*'; | |
sub err { |
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 IO::Socket qw[]; | |
use Net::FastCGI::Constant qw[ :type FCGI_NULL_REQUEST_ID FCGI_HEADER_LEN ]; | |
use Net::FastCGI::Protocol qw[ build_record parse_header get_type_name ]; | |
sub fatal ($;$); | |
sub timeout (&$$); |
NewerOlder