in reply to print to output problem

It seems I'm only posting this link today. <-- read that first.

What is your input? What do you think the output should be?

for each line, you are pushing 1 value into @outLines (so, you're adding one value to the end of the array) and then printing @outLines. That might be the source of your problem.

Replies are listed 'Best First'.
Re^2: print to output problem
by Anonymous Monk on Jul 07, 2004 at 16:30 UTC
    adding one value to the end of the array - this is why i included just after the while(<FILE>) empty the array i am pushing onto?
      I think you'll find that # starts a comment. so that line doesn't do anything.

      Also, generally people will tell you to use strict; and use warnings; at the top of your code. which might give you some interesting hints.

      update: I don't think you really understand split either. type perldoc -f split, especially this section:

      In scalar context, returns the number of fields found a +nd splits into the @_ array. Use of split in scalar conte +xt is deprecated, however, because it clobbers your subroutin +e argu- ments. If EXPR is omitted, splits the $_ string. If PATTERN i +s also omitted, splits on whitespace (after skipping any leadi +ng whitespace). Anything matching PATTERN is taken to be +a delim- iter separating the fields. (Note that the delimiter m +ay be longer than one character.)
        see first comment regarding @outLines