A
Arthur
Hi All,
I pulled this sort routine off from one of the postings. It works
well, but I was hoping someone could actually explain to me exactly
what it is doing:
@in = qw(one two two four seven four five one six);
@out = sort grep(!$saw{$_}++, @in);
print "@out";
I'm lost with this line: @out = sort grep(!$saw{$_}++, @in);
What is !$saw($_)++ ???
Thanks,
Arthur
I pulled this sort routine off from one of the postings. It works
well, but I was hoping someone could actually explain to me exactly
what it is doing:
@in = qw(one two two four seven four five one six);
@out = sort grep(!$saw{$_}++, @in);
print "@out";
I'm lost with this line: @out = sort grep(!$saw{$_}++, @in);
What is !$saw($_)++ ???
Thanks,
Arthur