in reply to strange uninitialized value problem

sub do_split { my @fields = split;
By default split operates on $_, while your argument is in @_. So all the $fields[N] lines are uninitialized.

Replies are listed 'Best First'.
RE: RE: strange uninitialized value problem
by jjhorner (Hermit) on Jun 02, 2000 at 21:54 UTC

    Either I'm missing something, or I'm dumb.

    $log = "something", do_split($log) should have a string, right?

    J. J. Horner
    Linux, Perl, Apache, Stronghold, Unix
    jhorner@knoxlug.org http://www.knoxlug.org/
    
      $log = "something", do_split($log) should have a string, right?

      Right, but that string is in $_[0] not $_.
      Try putting:

      shift;
      as the first line of your sub. That will pop $_[0] into $_;