Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Clean way of adding values to complex data structure

by ikegami (Patriarch)
on Jul 22, 2009 at 21:09 UTC ( [id://782445]=note: print w/replies, xml ) Need Help??


in reply to Clean way of adding values to complex data structure

without having to itterate though the entire data structure?

Of course not. You can't inspect the url of every page without visiting them.

Sets the flag for about pages, leaves it untouched for others:

$_->{flag} = 1 for grep { $_->{url} eq '/html/about.html' } @$pages;

Sets the flag for about pages, clears it for others:

$_->{flag} = ( $_->{url} eq '/html/about.html' ) for @$pages;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found