in reply to Re^2: Looping through an array of hashrefs
in thread Looping through an array of hashrefs
In that case, why not eliminate half the code in that loop?:
sub validate_properties { for ( @{$_[0]} ) { $_->{supported} = .5 < rand; } }
Or even inline it as: $_->{supported} = .5 < rand for @array;?
Based on the (modified) original post, it should be $_->{supported} = isSupported($_) for @properties; rather than random.
I don't see how saving the results of an isSupported() test could be described as "validating properties", but I suppose that's a lack of context speaking.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Looping through an array of hashrefs
by misterperl (Friar) on Sep 24, 2014 at 16:04 UTC |