little_mistress has asked for the wisdom of the Perl Monks concerning the following question:
Use of uninitialized value at test.pl line 10.#!C:\Perl\bin\perl.exe -w $file = 'foo.txt'; open(SESAME, $file); @lines = <SESAME>; close(SESAME); $total = @lines; for ($i=0; $i <= $total; $i++) { if ($lines[$i] eq "\n") # This is line the line { pop @lines; $i = $i -1; $total = @lines; } } print "There are $total records in $file\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I don't understand why I'm getting an unitialized value warning
by btrott (Parson) on Apr 12, 2000 at 23:28 UTC | |
by little_mistress (Monk) on Apr 12, 2000 at 23:45 UTC | |
|
Re: I don't understand why I'm getting an unitialized value warning
by chromatic (Archbishop) on Apr 12, 2000 at 23:48 UTC | |
|
Re: I don't understand why I'm getting an unitialized value warning
by plaid (Chaplain) on Apr 13, 2000 at 01:21 UTC | |
|
Re: I don't understand why I'm getting an unitialized value warning
by Doc Technical (Initiate) on Apr 13, 2000 at 10:36 UTC | |
by Doc Technical (Initiate) on Apr 13, 2000 at 10:38 UTC | |
|
Re: I don't understand why I'm getting an unitialized value warning
by Doc Technical (Initiate) on Apr 13, 2000 at 10:20 UTC |