in reply to Array question II

You should not have <[INPUT]>, but rather <INPUT>.

And if you checked to see what $index held, you'd see that it has a newline at the end of it. Try:

chomp($index = <STDIN>); if ($index eq 'Q') { ... }


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: Array question II
by tlynch001 (Initiate) on Mar 14, 2001 at 20:48 UTC
    But that gives me an array of elements, I was hoping that each "string" would be it's own list, giving me a list of list.

    Thanks,

    -tl

      In that case, you need to split each record as you read it from the file and push a reference to the resulting array onto your main array.

      Oh, and you really should start using use strict in your code. It'll find a lot of subtle bugs.

      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me