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 feature 'say'; | |
| my $target = 92; | |
| my @prices = (35, 46, 19, 7, 41, 27); | |
| # If we have command-line arguments |
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; | |
| use Plack::Test; | |
| use Plack::Util; | |
| use HTTP::Request::Common; | |
| my $app = Plack::Util::load_psgi './app.psgi'; |
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 feature 'say'; | |
| use MetaCPAN::Client; | |
| my $author_name = shift | |
| or die "Usage: $0 CPAN_AUTHOR_ID\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
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use feature 'say'; | |
| use DBI; | |
| my $dbh = DBI->connect( | |
| "DBI:mysql:database=test", |
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; | |
| my $logs; | |
| while (<>) { | |
| my ($date, $time, $type) = split; |
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
| function cpanver { | |
| for mod in "$@" | |
| do | |
| perl -M$mod -E"say qq[$mod - \$$mod::VERSION]" | |
| done | |
| } |
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 Imager::QRCode; | |
| my $url = shift || 'https://perlhacks.com/'; | |
| my $qrcode = Imager::QRCode->new; |
OlderNewer