in reply to Perl parse text file using hash
Unfortunately, "not working properly" is not a very helpful problem statement. All I can tell for sure is that your program fails to compile. And yes, the blast of compiler messages can be daunting.
You are actually doing a number of things right:
All the compile errors I get are due to undeclared variables. In fact, they end in the text (did you forget to declare "my ..."?). In some cases the fix is easy: just stick a "my" in front of the first assignment to the variable. In others you need to actually declare the value somewhere. For example, you need a my @fruits; somewhere above the call to parse(). And in some you need to think about where the value is to come from.
|
|---|