in reply to adding elements to already exisiting elements in an array
Without going in depth to your code, I can think of two ways of doing that:
push @list, $element unless grep {$_ eq $element} @list; #or keys %hash = @list; $hash{$element}++ unless exists $hash{$element};
Stop saying 'script'. Stop saying 'line-noise'.
We have nothing to lose but our metaphors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: adding elements to already exisiting elements in an array
by Narveson (Chaplain) on May 14, 2008 at 22:29 UTC |