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 strict; | |
| use warnings; | |
| use AnyEvent; | |
| use Data::Dumper; | |
| my $cv = AnyEvent->condvar; | |
| my $ae_signal_term = AnyEvent->signal( |
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 strict; | |
| use Cache::SharedMemoryCache; | |
| my $cache = Cache::SharedMemoryCache->new({namespace => 'foo', default_expire_in => "60s"}); | |
| while (1) { | |
| sleep 1; | |
| print $cache->get('bar')."\n"; |
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 strict; | |
| use warnings; | |
| use Test::More; | |
| # Those are stringify after. | |
| my ($x, $y) = (15, 8); | |
| # Only STRING and STRING bitwise-and is compared by ASCII!!! | |
| ok( !("$x" & "$y"), qq/is "$x" & "$y" = @{[ "$x" & "$y" ]} not true?/); |
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 | |
| # concat-wxr.pl *.txt > wxr.xml | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Data::Dumper; | |
| use Data::Section::Simple 'get_data_section'; | |
| use Date::Format 'time2str'; |
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 strict; | |
| use warnings; | |
| use lib 'lib', '../lib'; | |
| BEGIN { $ENV{DEBUG} = 1; } | |
| use Config::PL 'config_do'; | |
| use Data::Dumper; | |
| use Encode; |
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 | |
| # Initial release by @xtetsuji at 2013/11/10 | |
| # See following document for detail. | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use LWP::UserAgent; | |
| use Web::Query; |
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 | |
| # https://github.com/perl-entrance-org/workshop-2013-05/blob/master/slide.md#%E7%B7%B4%E7%BF%92%E5%95%8F%E9%A1%8C-1 | |
| use strict; | |
| use warnings; | |
| while(my $str = <STDIN>) { | |
| chomp $str; | |
| my $res = calc_strings($str); | |
| if ( defined $res ) { |
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 | |
| # https://twitter.com/onedrive/status/436167285259382784 | |
| use strict; | |
| use warnings; | |
| my %mapping = (qw/ | |
| A 3 | |
| B 0 | |
| C Q |
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 My::ClutchWorker; | |
| use strict; | |
| use warnings; | |
| use Clutch::Worker; | |
| register_function( | |
| 'echo' => sub { | |
| my $args = shift; | |
| $$ .':'. $args; # return worker process response. |
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 My::JonkWorker; | |
| use strict; | |
| use warnings; | |
| use Data::Dumper; | |
| sub work { | |
| my ($class, $job) = @_; | |
| print "job is " . Dumper($job) . "\n"; |