in reply to foreach problem

Apart from the obvious error caught by dws, I'd recommend keeping the my statements as locally scoped as possible, like this:
foreach my $data_line (@thermo_params) { my @thermos = split /\s+/, $data_line; print "$_\n" for @thermos[0,2]; }

-- Hofmator

Replies are listed 'Best First'.
Re: foreach problem
by Abigail-II (Bishop) on Feb 26, 2003 at 14:12 UTC
    Or just:
    local $" = "\n"; print "@{[(split) [0, 2]]}\n" for @thermo_params;

    Abigail