Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://178299]
help
Chatterbox?
[shmem]: karlgoethebier: of course
[shmem]: has there been any single day where nothing went wrong? not in my memory
[shmem]: discovered a fuel tank leakage at my second hand motorbike. Some bloke drove a screw too long through the fairing
[shmem]: hard to fix, and plans wrecked. And more... won't tell.
[shmem]: the leakage has been "fixed" with a piece of bycicle tube. Bleargh.
[karlgoethebier]: shmem: yes. my first ride tomorrow is questionable because of lumbago. shit
[shmem]: But! the bloke wasn't me, at least.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2017-06-25 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (570 votes). Check out past polls.