in reply to Use uninitialized value in string eq at line 44, <READER> line 1 (#1)
It would have be freindly if you could have added a comment to indicate which line is line #44 - it's a pain counting them.
I think that the line in question is
if ($events[1] eq ""){$lc = $line};
which probably means that you should change this to something like
Update:if (!defined $event[1] or $events[1] eq "")...
I assume (hope) the somewhat haphazard formating is as a result of cut&paste:)
Also, your line $line =~ s/\n$//; would be better written as chomp $line. It certainly more familiar, and may even be more efficient, not that that is likely to be much of a consideration.
I'm not quite sure what Courage means by "check your array is wide enough?
I'm not making a judgement here, I just don't understand the comment? Don't Perl's array grow to accomodate whatever you give them? Also, he is referencing $events[0] later in the code, so I assume that he is testing the second element of the line generated by the split with $event[1]?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Useuninitialized value in string eq at line 44, <READER> line 1 (#1)
by cal (Beadle) on Jul 21, 2002 at 20:37 UTC | |
by BrowserUk (Patriarch) on Jul 21, 2002 at 21:05 UTC |