in reply to idiotic syntax to pass to a sub
Hmmm... I'm not sure I understand you problem fully but I think you need to make sure you only have unique elements(i.e h1) in the @mak array
@mak = qw(h1, h2, h3, h1, h3); my %mak_table = (); foreach my $num ( @mak ) { $mak_table{$num}++; print "\n\n$mak_table{$num}\n"; # Only so you can se +e what is happening } my @unique_nums = sort keys %mak_table; print "@unique_nums\n";
Then you can use any of the unique values in the @unique_nums array.. Hope I'm not too far off the mark... that fishshop may not be a bad idea...
-----
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: idiotic syntax to pass to a sub
by thelenm (Vicar) on Nov 15, 2002 at 16:46 UTC |