in reply to Error message while reading from file

Just modify your loop.
foreach (<EXP>) { next unless m/\S/; ... }

Igor 'izut' Sutton
your code, your rules.

Replies are listed 'Best First'.
Re^2: Error message while reading from file
by davorg (Chancellor) on Feb 17, 2006 at 11:49 UTC

    Why switch from while to foreach?

    while (<EXP>) { next unless /\S/; ... }
    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re^2: Error message while reading from file
by salva (Canon) on Feb 17, 2006 at 11:46 UTC
    generaly, this is not a good idea as it will read the full file in memory and if the file is too big you can run out of RAM.