This file contains 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 (&$$); |
This file contains 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 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 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 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 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 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 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
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs | |
index eac682b..d324bdd 100644 | |
--- a/ext/PerlIO-scalar/scalar.xs | |
+++ b/ext/PerlIO-scalar/scalar.xs | |
@@ -125,6 +125,18 @@ PerlIOScalar_tell(pTHX_ PerlIO * f) | |
return s->posn; | |
} | |
+IV | |
+PerlIOScalar_eof(pTHX_ PerlIO * f) |
This file contains 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 unicode; | |
use strict; | |
use warnings; | |
use warnings::register; | |
use Carp qw[croak cluck]; | |
use Encode qw[]; | |
# from perl.h verified in 5.6.2, 5.8.9, 5.10.1 and blead (2010-02-27) | |
sub HINT_BLOCK_SCOPE () { 0x00000100 } |
This file contains 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; | |
# Transparent singleton methods in Perl | |
# First a new anonymous class is created to hold the object's singleton | |
# methods, this anonymous class assumes the role of the object's class | |
# and the original class is designated as the super class of that anonymous | |
# class. This is completely transparent and the anonymous class can't be | |
# referenced by name. |
OlderNewer