P is for Practical | |
PerlMonks |
Re: How do I dynamically populate a hash after parsing columns from a fileby wfsp (Abbot) |
on Mar 09, 2011 at 10:34 UTC ( [id://892170]=note: print w/replies, xml ) | Need Help?? |
You provided a short script with some sample data and monks are reporting that your script worked ok for them. I downloaded the code too but had to make a few small changes (the other monks must have done something similar).
I commented out the line and changed the two subsequent occurences of IN to DATA (i.e. use the sample data). Worked ok for me too. Your algorythm's fine, this is useful to know and points you further up the script. The question becomes, "Is the input what you think it is?" Is the file your opening actually the file you think it is. For me at least, a common and frustrating state of affairs. :-) Perhaps consider what I do in these cases. I put in some debugging code that prints the first 10 lines of the file after its been opened. Add loud delimiters to the start and end of each line, say, ***. This can help identify any issues with white space/new lines etc. Have a good look. Is it, as lostjimmy suggests, empty? Good luck!
In Section
Seekers of Perl Wisdom
|
|