"Shishir K. Singh" wrote: > >on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote: > > > What is the most efficient (or at least AN efficient :-) way of > > obtaining a slice from an array wherein the slice contains only > > unique values found in the array? > > >See > > perldoc -q duplicate > > -- > >felix > This is the example "d" cited in perldoc -q duplicate > d) A way to do (b) without any loops or greps: > > undef %saw; > @saw{@in} = ();
This is called a hash slice, this is same as writing foreach (@in) { $saw{$_} = undef } > > @out = sort keys %saw; # remove sort if undesired > > I am a bit confused about this example ?? > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]