Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Loop Array - If $var is something write values until $var is something else

by davido (Cardinal)
on Sep 29, 2018 at 19:21 UTC ( #1223288=note: print w/replies, xml ) Need Help??


in reply to Loop Array - If $var is something write values until $var is something else

So is it accurate that your datastructure looks something like this?

my @cleared = ( 'Something', {JobProfil => undef}, {JobProfil => 1}, 'Something else that should match', 'This one should not match', );

Why are there hashrefs in some elements and not in others? Possibly the first test you should be doing is checking if $x contains a reference, at each iteration. Otherwise, you'll be trying to dereference $x as a hashref when it's actually just a plain old string. This would run afoul of strict 'refs';.


Dave

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2019-05-25 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (152 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!