Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Use of uninitialized value in array element

by Fastolfe (Vicar)
on Jul 12, 2002 at 15:56 UTC ( [id://181321]=note: print w/replies, xml ) Need Help??


in reply to Use of uninitialized value in array element

What if one of these conditions fails:
my ($ts,$cat) = $vals[0] =~ /TS(\d+)(.+)$/; ... for(0..$#cats) { if ($cats[$_] =~ /$cat/) { $j = $_ } } for(@{$groups[0]}) { if ($ts == $_) { $i = 0 } } for(@{$groups[1]}) { if ($ts == $_) { $i = 1 } } for(@{$groups[2]}) { if ($ts == $_) { $i = 2 } }
It looks like somehow, somewhere, either $i or $j is left undefined. Add some print statements in your loops that print out the values of your various variables and check that your assumptions are valid here. Could there be an empty line in your input?

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://181321]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-18 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found