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; |
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; | |
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
#!/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; | |
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
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'; | |
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
#!/usr/bin/perl | |
# | |
# Perl Weekly Challenge #19 / Task #1 | |
# | |
# Write a script to display months from the year 1900 to 2019 where | |
# you find 5 weekends i.e. 5 Friday, 5 Saturday and 5 Sunday. | |
use strict; | |
use warnings; | |
use feature 'say'; |
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 SVG; | |
my $PICWIDTH = 22; | |
my $svg = SVG->new(width => 184, height => 200); |
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 CGI qw(param header); | |
my $title = 'Blood Test'; | |
my $content = param('bloodtype') ? get_results() : get_form(); | |
print header; |
NewerOlder