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 plackup | |
| use strict; | |
| use warnings; | |
| use Data::Dumper; | |
| use Plack::Request; | |
| use Plack::Response; | |
| my $app = sub { |
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 -l | |
| package Model; | |
| use Moose; | |
| has state => ( is => 'ro', reader => 'get_state', default => 0 ); | |
| sub set_state { $_[0]->{state} += $_[1] } | |
| package View; | |
| use Moose; | |
| sub update_display { print $_[1]->get_state } |
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
| prove -rl --formatter=TAP::Formatter::JUnit --timer > junit.xml |
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
| perl -MData::Dumper -MJSON -MFile::Slurp -e"print Dumper decode_json read_file shift" foo.json |
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
| perl -e'print /\s+/ ? $/ : unpack B8 => $_ for split //, shift' 'hello world ' |
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 Data::Dumper; | |
| use Getopt::Long; | |
| use Pod::Usage; | |
| GetOptions ( | |
| 'r|remote=s' => \my $remote, |
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 | |
| package LWP::Authen::OAuth2::Dancer; | |
| our $VERSION = '0.1'; | |
| use Dancer ':syntax'; | |
| use Net::Twitter; | |
| use Scalar::Util 'blessed'; | |
| our $nt = Net::Twitter->new( | |
| traits => [qw/API::RESTv1_1/], | |
| consumer_key => '', |
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 | |
| package LWP::Authen::OAuth2::Dancer; | |
| our $VERSION = '0.1'; | |
| use Dancer ':syntax'; | |
| use LWP::Authen::OAuth2; | |
| our $oauth2 = LWP::Authen::OAuth2->new( | |
| client_id => '', | |
| client_secret => '', | |
| service_provider => 'Google', |
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 DBI; | |
| # connect | |
| my $dbh = DBI->connect( | |
| qw(DBI:mysql:mp3:host user pass), | |
| { RaiseError => 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
| use strict; | |
| use warnings; | |
| use Math::Matrix qw(transpose); | |
| use Spreadsheet::ParseExcel::Simple; | |
| use Spreadsheet::WriteExcel::Simple; | |
| my $xls = Spreadsheet::ParseExcel::Simple->read('old.xls'); | |
| my @data; | |
| for ($xls->sheets) { | |
| while ($_->has_data) { |