Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 lurking in the Monastery: (5)
As of 2025-07-14 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.