in reply to array split problems

replace the line:
$line = chomp ($line);
with simply:
chomp ($line);
and your troubles will all be behind you...

Replies are listed 'Best First'.
Re: Re: array split problems
by Anonymous Monk on Jan 20, 2004 at 16:41 UTC
    That worked perfectly thanks very much. Can you tell me why the line I wrote wouldn't work?

      perldoc -f chomp returns:

      chomp VARIABLE chomp( LIST ) chomp This safer version of "chop" removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the "English" module). It returns the total number of characters removed from all its arguments.

      Your code didn't work because of the following statement: It returns the total number of characters removed from all its arguments..

      /oliver/

      Because chomp() returns the characters removed, not the characters remaining.

      The PerlMonk tr/// Advocate