Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Re: Re: Deleting undef values from a hash

by ysth (Canon)
on Dec 15, 2003 at 00:04 UTC ( #314719=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Deleting undef values from a hash
in thread Deleting undef values from a hash

It should be ok for perl5, though. The division of responsibilities between hv_delete_* and pp_delete pretty much require that it work. hv_delete_* will return null if the key didn't exist, which pp_delete will replace with the immortal undef value. If the key did exist, hv_delete_* will return the value (even undef) in a different sv.

It's obviously better practice to check exists in the first place, outside of obfuscation and golf.

  • Comment on Re: Re: Re: Deleting undef values from a hash

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://314719]
Discipulus nevers ignores who is here since ever
[Eily]: IIRC 3% of all humans in history never ever died
[NodeReaper]: this is emotional, what did I do to deserve this?
[Discipulus]: Eily this percentage get higher everyday i suppose
Discipulus sometimes i'm here alone with you, bony brother
[Discipulus]: ok a Perl one: how approach the task of getting all distinct paths from the edge to a node of a pascal triangle (nobackwards)?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2018-03-19 10:49 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.