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/bn/env perl | |
| use 5.12.1; | |
| use warnings; | |
| package Foo { | |
| use Devel::GlobalDestruction; | |
| sub new { bless {}, ref $_[0] || $_[0] } | |
| sub DESTROY { |
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 5.12.1; | |
| use warnings; | |
| #use POSIX qw/_exit/; | |
| package Foo { | |
| use Moose; | |
| sub DEMOLISH { | |
| my ( $self, $in_global_destruction ) = @_; |
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
| sub retry_once { | |
| my ($code, $msg) = @_; | |
| try { $code->() } | |
| catch { | |
| WARN "RETRY $msg: $_"; | |
| try { $code->() } | |
| catch { | |
| ERROR "FAIL $msg: $_"; | |
| }; |
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 5.12.1; | |
| use warnings; | |
| use strict; | |
| use ZeroMQ qw/:all/; | |
| use ZeroMQ::Raw qw/zmq_device/; | |
| my $worker_address = 'ipc:///tmp/workers.sock'; |
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
| sub nt_with_retry { | |
| my ( $nt, $method, @args ) = @_; | |
| my $result; | |
| my $redo = 0; | |
| my $delay = 0.25; | |
| do { | |
| try { | |
| $result = $nt->$method(@args); |
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 Twitter::Keys; | |
| use strict; | |
| use warnings; | |
| use base 'Exporter'; | |
| our @EXPORT = qw(consumer_key consumer_secret access_token access_token_secret); | |
| my %tokens; | |
| # I used <DATA> for simplicity | |
| for ( <DATA> ) { | |
| chomp; |
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
| # tokens.pl | |
| package My::Consumer; | |
| sub key () { 'foo' } | |
| sub secret () { 'eyes-only!' } | |
| 1; | |
| =head1 SYNOPSIS |
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 warnings; | |
| use strict; | |
| use Net::Twitter::Lite; | |
| use lib '../../files/perl/lib'; | |
| use Base::Roots qw(get_data); | |
| my %consumer_tokens = ( |
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
| import XMonad | |
| import System.IO | |
| import qualified XMonad.StackSet as W | |
| import Data.Ratio ((%)) | |
| import XMonad.Actions.Commands | |
| import XMonad.Hooks.DynamicLog |
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 Test::More; | |
| use O qw/-qq Deparse/; | |
| package Foo; | |
| sub Bar {} | |
| package Foo::Bar; | |
| sub new { bless {}, shift } |