--- [EMAIL PROTECTED] wrote:
> This is going off of two assumptions, 1) that you want the task number to be
> unique and 2) the fields are supposed to be tab delimited. If you want to
> remove the dups from a different column then make that column as the key to
> the hash. As for which fields, you can add and remove any column from the
> value of the hash. Hope this helps.
>
>
> open FILE, "file";
> open OUT, ">outfile";
Without really checking out the rest of the code, I see a problem here.
What happens if 'file' or 'outfile' don't exist? This code will silently fail and
tracking down
the bug could be a pain if this is embedded in a large system. This is such a common
problem that
"use strict 'system'" is being considered for Perl 6. With this, the script would
automatically
die if someone forgets to check the return value of a system call. The above code is
better
written as:
open FILE, "$file" or die "Can't open $file for reading: $!";
open OUT, "> $outfile" or die "Can't open $outfile for writing: $!";
I know, I know, I can hear the protests already: "but Ovid, you're just being
anal-retentive.
This programmer *knows* the files are there."
That's a frequent rebuttal, but if you work with Perl for any length of time, you're
likely to
have many programs just lying around. I've repeatedly seen people get bitten by this
when they
reorganize directories, migrate their scripts to new boxes, or simply get rid of
'unnecessary'
files to save some disk space. It takes so little work up from to save so much pain
later.
Cheers,
Curtis Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]