Removing duplicates in arrays

2003-10-22 Thread Marius Roets
I know this has been asked before, but I can't seem to find it. Is there a simple way to remove duplicates from an array. Currently I sort the array, and then iterate through the sorted array, and push elements into a new array when its different than the previous one. I have read somewhere of a on

Re: using foreach on an array

2003-09-22 Thread Marius Roets
Wow, I didn't know that, and I have been using Perl for some time. Never too old to learn. >> The answer is in 'perldoc perlsyn': The "foreach" loop iterates over a normal list value and sets the vari- able VAR to be each element of the list in turn. If the variable is precede

Re: DBI.pm

2003-08-29 Thread Marius Roets
It is basically looking for the DBI module. DBI is a database independent Perl interface to databases, much like ODBC in the M$ environment. It means that in the program you are trying to run there is a "use DBI;", but Perl can't find the source file DBI.pm in the list of directories. This proba

Re: absolute newbie: tab-delimited files

2003-08-27 Thread Marius Roets
Try on of these 2 options: #!/usr/bin/perl ... chomp ($filename1 = ); #open(FILE1, $filename1); [EMAIL PROTECTED] = ; @input1 = ; print ("lines : @lines\n"); ### Option 1 foreach (@input1) { /^(\w+)\s/; ## Asuming the id is alpha numerical push (@ids1,