Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How do I print a partial array?

by Bloodelf (Beadle)
on Jun 19, 2001 at 01:08 UTC ( [id://89453]=note: print w/replies, xml ) Need Help??


in reply to How do I print a partial array?

Another way....

foreach ( @b ) { print "$_\n" if defined $_; }

Edited by davido: Added "defined" to conditional so that elements containing '0' would still print, while undefined elements are skipped.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-23 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found