XP is just a number | |
PerlMonks |
uninitialized errorby rufessor (Initiate) |
on Feb 26, 2013 at 19:27 UTC ( [id://1020745]=perlquestion: print w/replies, xml ) | Need Help?? |
rufessor has asked for the wisdom of the Perl Monks concerning the following question:
Hi All-
So this error is confusing me (a Perl beginner but with some experience) as well as someone I consider to be very far from a beginner and thus this post. Basically I have a tab delimited file which comes from the output of another bit of code. This is opened and read line by line in a presumably simple operation to populate a complex data structure (Hash{key}{value}->(Array)) where the key and value are fields pulled from the line and the array is the entire line stored for later use. The issue is that sometimes when I split the line on tabs for whatever reason it *misses* one of the fields leaving it as uninitialized. The very very strange thing is that I can see this in the debugger but if I execute the split command from within the debugger... its just fine. So... any help would be great.- code snippet and debugger view of this error is below- FYI perl -v tells me that... This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail)
and the debugger transcript showing this very odd (to me) behavior is below.... NOTE that when I command line execute the split on the line it works perfectly.. but somehow the actual executed code is failing
So I went ahead and wrote a test script doing only the split and using the same file and print out both the line and the split line and that script works just fine... in that the print statement shows the line and the split line to be identical over all (well... I admit I didn't look at all 80,000 lines... but I cannot find any errors in that so the input file is OK... its just somehow this code thats causing issues... but its so simple! HAHAH... always simple that kills.... Update: Hold.... working on this for a minute... had an idea to test before bothering everyone.
Back to
Seekers of Perl Wisdom
|
|