Created
October 14, 2015 13:51
-
-
Save andrewsolomon/c27f904049ac1d6f4e37 to your computer and use it in GitHub Desktop.
The Perl references game
This file contains 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 feature 'say'; | |
use Data::Dumper; | |
my $big_bird = 500; | |
# 1 | |
my $count_von_count = sub { 100 * (1 + int (rand (5))); }; | |
# 6 | |
my $oscar = \$big_bird; | |
# 5 | |
my @cookie_monster = (20, 'yum', 'munch', $oscar, $count_von_count); | |
# 4 | |
my %bert = ( | |
schu => '?', | |
camem => '30', | |
cookie => \@cookie_monster, | |
count => $count_von_count, | |
); | |
# 3 | |
my $ernie = [ 40, \%bert, $count_von_count]; | |
# 2 | |
my $kermit = { | |
me => 'frog', | |
you => 50, | |
him => $ernie, | |
number_man => $count_von_count, | |
}; | |
say $kermit->{you}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment