Skip to content

Instantly share code, notes, and snippets.

@marcoonroad
Created September 15, 2014 16:34
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 marcoonroad/d1516697b71662e14c46 to your computer and use it in GitHub Desktop.
Save marcoonroad/d1516697b71662e14c46 to your computer and use it in GitHub Desktop.
Playing with complex data Structures at Perl 5...
#!/usr/bin/perl
use feature qw/ say /;
use warnings;
my @Array = ([1 .. 10], [11 .. 20], [21 .. 30]);
my $CodeRef = sub { shift; say for @_ };
for (0 .. 2) {
unshift @{ $Array[$_] }, \&{ $CodeRef };
$Array[$_] -> [0] -> (@{ $Array[$_] });
}
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment