Re: Unique list

2010-09-17 Thread Jordi Durban
Thank you very much for your answers. Yesterday I was so exhausted that my brain didn't work and I didn't know how to explain what I was looking for. Actually I was trying to do a perl script to compare two strings according to the identity Blast program index (bioinformatics). As input file I have

Re: Unique list

2010-09-16 Thread Chas. Owens
On Thu, Sep 16, 2010 at 11:27, Jordi Durban wrote: > Hi all! > I would like to ask you something. I have a file as follows: > File A           File B > uid = 1         uid = 4 > uid = 2         uid = 3 > uid = 3         uid = 2 > uid = 4         uid = 1 > > I'm trying to make a perl script to get

Re: Unique list

2010-09-16 Thread Steve Bertrand
On 2010.09.16 11:27, Jordi Durban wrote: > Hi all! > I would like to ask you something. I have a file as follows: > File A File B > uid = 1 uid = 4 > uid = 2 uid = 3 > uid = 3 uid = 2 > uid = 4 uid = 1 > > I'm trying to make a perl script to get me only th

Re: Unique list

2002-05-14 Thread drieux
On Monday, May 13, 2002, at 12:36 , Jackson, Harry wrote: [..] > > sub unique { > foreach (@_) { $_{$_}++} > return [keys %_]; > } > > > Or you could butcher the grep method as I have done to get the following > > sub GrepMe { > return [ grep { not $\{$_}++ } @_ ]; >

RE: Unique list

2002-05-13 Thread Jackson, Harry
>-Original Message- >From: drieux [mailto:[EMAIL PROTECTED]] >> >> sub unique { > >neat function > >> } > >may I counter propose based upon the benchmarks > >http://www.wetware.com/drieux/pbl/BenchMarks/uniqbyRefOrArray.txt > >ciao >drieux > >--- > >ps: harry, I have referenced

RE: Unique list

2002-05-13 Thread Jackson, Harry
>-Original Message- >From: drieux [mailto:[EMAIL PROTECTED]] > >ps: harry, I have referenced you as the originator >of the function - if that is incorrect - please send >me email back channel indicating who should be blamed. I am indeed the culprit. H **

Re: Unique list

2002-05-13 Thread drieux
On Monday, May 13, 2002, at 07:07 , Jackson, Harry wrote: [..] >> -Original Message- >> From: Lance Prais [mailto:[EMAIL PROTECTED]] > > I seem to require what you want a lot so wrote this. Pass the arrays you > want the unique values of as references to this sub routine. There is no > ch

RE: Unique list

2002-05-13 Thread Jackson, Harry
>-Original Message- >From: Lance Prais [mailto:[EMAIL PROTECTED]] I seem to require what you want a lot so wrote this. Pass the arrays you want the unique values of as references to this sub routine. There is no checking for the amount of arrays passed and will currently handle 4. su

Re: Unique list

2002-05-06 Thread Michael Lamertz
On Mon, May 06, 2002 at 11:40:10AM -0700, drieux wrote: > > I'm very confused by the idea of > > my %args = ( > PARTITION => '', > PARTITIONFILE => '', > OUTPUTFILENAME => '', > @_, > ); > > why not the simpler > > my (

Re: Unique list

2002-05-06 Thread drieux
On Monday, May 6, 2002, at 10:34 , Lance Prais wrote: > Thank you in advance http://www.wetware.com/drieux/CS/lang/Perl/Beginners/BenchMarks/FileWayuniqDeList. txt may help see the complications of doing this with File IO I can understand the habit of 'directly porting' from /bin/sh model

Re: Unique list

2002-05-06 Thread drieux
On Monday, May 6, 2002, at 10:34 , Lance Prais wrote: > sub createUniquePartitionFile { > my %args = ( > PARTITION => '', > PARTITIONFILE => '', > OUTPUTFILENAME => '', > @_, > ); > $status = 0; > $partitionFile = $a

Re: Unique list

2002-05-06 Thread Jonathan E. Paton
> I would like to create a unique list. Buy the Cookbook or search the archives, since this is a common question. Basically one of the following two solutions is best. %seen = (); @unique = grep { not $seen{$_}++ } @list_A, @list_B; OR: %seen = (); $seen{$_}++ for @list_A, @list_B; @unique =