Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: how many lines returned from backticks

by little (Curate)
on Jun 30, 2002 at 02:47 UTC ( #178299=note: print w/ replies, xml ) Need Help??


in reply to how many lines returned from backticks

try

# in scalar context an array # will return the number of its elements print scalar @lines; #which leads to if (scalar @lines) { #array is not (an) empty (list) ... }
Regarding your question there is no need to worry if th earray gets newly populated each time, but if not in a block (especially loop) you might avoid such case by simply resetting the array with "@lines = ();".

Have a nice day
All decision is left to your taste


Comment on Re: how many lines returned from backticks
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2015-07-31 19:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls