Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [23:44][markca@app-1001:~/projects]
- $ cat test.pl
- my $hash = {
- '1' => 'a',
- '2' => 'b',
- '3' => 'c',
- '4' => 'd',
- };
- print "Keys: \n";
- foreach (keys(%{$hash})) {
- print $_ . "\n";
- }
- print "Values: \n";
- foreach (values%{($hash)}) {
- print $_ . "\n";
- }
- [23:44][markca@app-1001:~/projects]
- $ perl -w test.pl
- Keys:
- 4
- 1
- 3
- 2
- Values:
- d
- a
- c
- b
Add Comment
Please, Sign In to add comment