Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

•Re: Re: Removing blank lines from array

by merlyn (Sage)
on Feb 28, 2002 at 16:53 UTC ( #148274=note: print w/ replies, xml ) Need Help??


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


Comment on •Re: Re: Removing blank lines from array
Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://148274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-12-27 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls