in reply to Help with recurring "uninitialized variable" problem.

Try this:

while (defined (my $one_line = <>)) { if ($one_line =~ !/^#+/) { ($source, $destination, $bytes) = split(/ /, $one_line); $net_activity{$source}{$destination} += $bytes; }# ignore comments }# read in each line of the net log

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re: Re: Help with recurring "uninitialized variable" problem.
by C_T (Scribe) on Apr 09, 2004 at 16:58 UTC
    Ovid wrote:
    Try this:
    while (defined (my $one_line = <>))
    This gives the same warnings, I'm afraid.

    C_T

    Charles Thomas
    Madison, WI

      How are you getting your values in @ARGV? I think one of more of them is undef. As a quick test, try adding the following line before the while loop. If it suppresses the warnings, you have undef values there.

      @ARGV = grep defined() => @ARGV;

      Cheers,
      Ovid

      New address of my CGI Course.