Skip to content

Instantly share code, notes, and snippets.

@exodist
Created January 26, 2016 16:38
Show Gist options
  • Save exodist/5d7c04bf93c1535b2e46 to your computer and use it in GitHub Desktop.
Save exodist/5d7c04bf93c1535b2e46 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
my %stuff = (
a => 1,
b => 2,
c => 3,
);
while (my ($k, $v) = each %stuff) {
print "Key: $k, value: $v\n";
do_stuff();
}
sub do_stuff {
print "Keys: " . join(', ' => keys %stuff) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment