Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: how to delete without resulting in undef

by jbrugger (Parson)
on Nov 17, 2005 at 06:42 UTC ( [id://509308]=note: print w/replies, xml ) Need Help??


in reply to how to delete without resulting in undef

However if you WANT to use 'delete', you allways can do it like this:
#!/usr/bin/perl -w use strict; # updated: Assuming you use strict and warnings :) my @a = (1..10); undef $a[3]; foreach (@a) { print $_ if defined($_); }
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-28 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found