in reply to Array Help

This may not be the best solution, but as ever, TMTOWTDI¹ ;-)
#!/usr/bin/perl -w use strict; use vars qw( @array %hash $number ); @array = (1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3); print "@array\n"; foreach $number (@array){ $hash{$number}++; } @array = keys %hash; print "@array\n";

1:There's More Than One Way To Do It

Replies are listed 'Best First'.
RE: Re: Array Help
by Anonymous Monk on Oct 11, 2000 at 22:55 UTC
    Thanks Kilinrax, one more question... what does TMTOWTDI stand for?
      TMTOWTDI== "There's More Than One Way To Do It".

      The battle cry of Perl programmers the world over.