Skip to content

Instantly share code, notes, and snippets.

@codepedia
Created February 1, 2016 02:03
Show Gist options
  • Save codepedia/ae1c72960d09060277ff to your computer and use it in GitHub Desktop.
Save codepedia/ae1c72960d09060277ff to your computer and use it in GitHub Desktop.
Print keys and values from hash
The \A and \Z are just like "^" and "$"
my @keys;
while (<>) {
chomp; # Or: s/\s+\z//;
push @keys, $_;
}
my %hash; @hash{@keys} = @values;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment