On Wed, Jan 03, 2001 at 11:16:06AM +0000, Piers Cawley wrote:
> > How can I do this:
> >   my @list = qw/foo bar foo baz/;
> >   my %hash = map { $_ => 1 } @men;
> >   my @sort = sort keys %hash;
> >   print "We have @sort\n"; # foo bar baz
> > without the %hash?

> my $last;
> do {print $_ unless $_ eq $last; $last = $_} for sort @list
> Dunno if it's quicker than the cunning tricks with map, but hey, it
> works. 

Ah, but my question was badly phrased. I needed to end up with @sort, not
a printed list ... 

The result of this was heading towards another couple of maps ;)

I had found the solution long before this turned up though (stupidly
forgot to update my .muttrc for the new list address, so I had to go
through moderation again ...) - just a matter of doubling those curly
brackets (no need for all those +s etc...)

Thanks,

Tony
-- 
-----------------------------------------------------------------------------
 Tony Bowden | Belfast, NI | [EMAIL PROTECTED] | www.tmtm.com | www.blackstar.co.uk
  you move in waves like the midnight blues you vector of this weird dis-ease
-----------------------------------------------------------------------------

Reply via email to