Skip to content

Instantly share code, notes, and snippets.

@andrewsolomon
Created October 14, 2015 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewsolomon/c27f904049ac1d6f4e37 to your computer and use it in GitHub Desktop.
Save andrewsolomon/c27f904049ac1d6f4e37 to your computer and use it in GitHub Desktop.
The Perl references game
#!/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