in reply to Re: Removing blank lines from array
in thread Removing blank lines from array

Or even better-better as:
chomp(my @info = grep /\S/, <READ>);

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: •Re: Re: Removing blank lines from array
by PrakashK (Pilgrim) on Feb 28, 2002 at 17:26 UTC
    Shouldn't that be:
    my @info; chomp(@info = grep /\S/, <READ>);
    so that @info is accessible later?

    /prakash

      @info will still be visible after the chomp(). There is no enclosing scope there to cause the lexical nature to release the array.

      --rjray