in reply to best data structure
# Create an initial list @list = (9,2,3,4,5,6); # Data we wish to insert @insert_data = 4..9; # For every datum that we wish to # insert, check for it's existance # in the list and append it if it is # not found foreach $item (@insert_data){ next if grep /$item/, @list; push @list, $item; } # Print out our final list foreach $item (@list){ print $item, ","; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: best data structure
by fruiture (Curate) on Aug 28, 2002 at 14:29 UTC | |
|
Re: Re: best data structure
by rob_au (Abbot) on Aug 28, 2002 at 13:58 UTC |