in reply to storing variable names in an array
#!/usr/bin/perl %a_hash = ( "file1", "tom", "file2", "bob", "file3", "joe"); $vale_from_hash = $a_hash{"file2"}; # Should return "bob" $a_hash{"file2"} = "Sam"; # file2 should now be "Sam" $vale_from_hash = $a_hash{"file2"}; # Should now return "Sam" print( %a_hash ); # Pairs will be matched but usually out of order you + expect
|
|---|