Hi List
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 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 (@imgids) {push(@used_images, $_) unless (grep { /^$_$/ }
@used_images);}
$_[0]->{_used_images} = [EMAIL PROTECTED];
Anyone know of a way of doing it without dereferencing it.
TIA
Angie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>