John W. Krahn wrote:
Angie Ahl wrote:
I've got a way to do this but I thought someone more experienced than
me might have a better way.
I have a class that is a hash and one of the hash values is an array ref.
I'd like to search that array and push to it if a value isn't there.
At the moment
Angie Ahl wrote:
> Hi List
Hello,
> I've got a way to do this but I thought someone more experienced than
> me might have a better way.
>
> I have a class that is a hash and one of the hash values is an array ref.
>
> I'd like to search that array and push to it if a value isn't there.
> At the
> I'd like to search that array and push to it if a value isn't there.
> At the moment I'm dereferencing the array, searching/pushing it and
> the passing it back to the class as an array ref again. So this mean
> copying the array. Code:
>
> my @used_images = @{$_[0]->{_used_images}};
> foreach (