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;
|
|---|