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 5.010; | |
use utf8; | |
use encoding 'utf8'; | |
my $gbp = '£1.30'; | |
my $usd = '$1.50'; |
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 5.010; | |
use English; | |
for ( 0 .. 5 ) { | |
next if ( fork() > 0 ); # Remember, fork returns zero to the child, and the PID of the child to the parent. | |
identify_yourself(); # This sends the child process on its merry way. |
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 5.014; | |
use DateTime; | |
use Test::More tests => 12; | |
use Test::MockModule; | |
# Fancy new package block syntax |
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.010;use strict;use warnings; | |
use Test::More tests => 5; | |
use DateTime; | |
use FindBin qw/$Bin/; | |
use IO::File; | |
use Fcntl qw/:DEFAULT/; |
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 Animal; | |
use Seahorse; | |
use Chicken; | |
sub new { | |
my ($pkg, %opts) = @_; | |
my $self = { %opts }; | |
$self->{name} //= 'Dunno'; |
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.010; | |
use strict; | |
use warnings; | |
use Mojolicious::Lite; | |
# Here's our validator construct | |
plugin 'validator' => { | |
messages => { |
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; | |
local $| = 1; | |
## Yeah, don't do this. There's an issue in SL4A's Perl (or the API) which causes this to make the Android->new() hang. | |
# local $/ = undef; | |
use lib qw/./; |
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.010; | |
use strict; | |
use warnings; | |
# I know that Mojolicious also uses all of the super-fun use strict and use warnings, | |
# but I still feel irrationally compelled to put them in myself. I hereby offer my non-apology. | |
use Mojolicious::Lite; | |
use MongoDB; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/background_dark" | |
android:gravity="center_horizontal" | |
android:orientation="vertical" > | |
<TextView | |
android:layout_width="wrap_content" |
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.010; | |
use strict; | |
use warnings; | |
use Test::More tests => 7; | |
sub count_bits { | |
my ($num, $size) = @_; | |