in reply to Re^2: Read file in a hash and compare the 'values' from file 2
in thread Read file in a hash and compare the 'values' from file 2

Thanks for the code, Now I got my keys and va... what I need now is to open ...

My code merely demonstrates how your code fragment doesn't work. The hash only contains one key value pair.

Its an example of runnable code.

You claim %hash is correctly populated? Then you need to show that code, and make sure it is runnable in a similar fashion as I did.

If you want to start with my code, you need to edit the program until %hash is correctly populated, while at the same time changing the function/variable names to be meaningful. Use Data::Dumper at various points to see where your assumptions don't match, its part of the Basic debugging checklist.

$outputFile doesn't make sense as a variable name for a file that you wish to read from.

Similarly NotDemoMeaningfulName and Boobly aren't great function names.

See Is PerlMonks a good place to get answers for homework?

  • Comment on Re^3: Read file in a hash and compare the 'values' from file 2