LovePerling has asked for the wisdom of the Perl Monks concerning the following question:
I've a file containing mulitple hashes, say filename my_hash_list.pl .
I want to write a code to fetch those hashes based on parameter passed to a new file, say file name fetch_hash.pl Eg (my_hash_list.pl) my contain.my %first_hash("fruit" => banana, "Vegetable" => tomato); my %second_hash("work" => office, "family" => home); my %third_hash("TV" => sony, "Phone" => apple);
now i want to get the hash from my second file, fetch_hash.pl by executing.
perl fetch_hash.pl first_hash
perl fetch_hash.pl second_hash
perl fetch_hash.pl third_hash
Can anyone help me with this. Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Working with Hashes (stored in other files)
by stevieb (Canon) on Jun 12, 2016 at 12:57 UTC | |
by Anonymous Monk on Jun 14, 2016 at 12:34 UTC | |
by LovePerling (Initiate) on Jun 14, 2016 at 12:38 UTC | |
by hippo (Archbishop) on Jun 14, 2016 at 12:46 UTC | |
Re: Working with Hashes
by graff (Chancellor) on Jun 12, 2016 at 13:45 UTC | |
by Anonymous Monk on Jun 14, 2016 at 12:33 UTC | |
by LovePerling (Initiate) on Jun 14, 2016 at 12:38 UTC | |
Re: Working with Hashes
by QuillMeantTen (Friar) on Jun 12, 2016 at 11:52 UTC |