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

Re^6: Array to hash converstion

by gem555 (Acolyte)
on Jul 15, 2009 at 10:25 UTC ( [id://780242]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Array to hash converstion
in thread Array to hash converstion

$correction = $data_pair->{value} if($data_pair->{key} eq 'correct');
how to store the value in $correction only if the $data_pair->{value} is not empty.

Replies are listed 'Best First'.
Re^7: Array to hash converstion
by Anonymous Monk on Jul 15, 2009 at 10:41 UTC
    check to see if it is empty (whatever that means :D)
    $correction = $data_pair->{value} if exists $data_pair->{value} and # could be undef defined $data_pair->{value} and # at least "" length $data_pair->{value} and # has length $data_pair->{value} and # has true value $data_pair->{key} eq 'correct';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2026-04-20 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.