in reply to Re^3: Control Structure problem, mistake can't be found
in thread Control Structure problem, mistake can't be found

Your comment seems funny to me (in a good way, really!) because I would normally code your example as
my @lines = map { chomp; [split] } <SHEET>;
or, if I suspected that the "SHEET" could point to a very big file,
my @lines; chomp, push @lines, [split] for <SHEET>;
both of which do need a _lot_ of perl knowledge to be read, aside from the CS knowledge you mentioned...
Update: obviously, blazar is right. and I should've written my examples as:
my @lines = map [split], <$sheet>;
and
my @lines; push @lines, [split] while <$sheet>;
because for was just wrong and because split already chomped the string...
[]s, HTH, Massa (κς,πμ,πλ)

Replies are listed 'Best First'.
Re^5: Control Structure problem, mistake can't be found
by blazar (Canon) on Aug 26, 2008 at 13:27 UTC
    or, if I suspected that the "SHEET" could point to a very big file,
    my @lines; chomp, push @lines, [split] for <SHEET>;

    I personally believe that it wouldn't make a difference, unless you're already running Perl 6 since it has lazy evaluation by default; but in that case the syntax for the iterator would be completely different. Under Perl 5 you probably mean:

    my @lines; chomp, push @lines, [split] while <$sheet>;

    (This reply is intended mostly for the benefit of the OP which is also the reason why I incidentally changed the filehandle to a lexical variable which is what one should use in most cases nowadays.)

    --
    If you can't understand the incipit, then please check the IPB Campaign.