On Fri, May 2, 2008 at 10:44 AM, rubinsta <[EMAIL PROTECTED]> wrote:
snip
> Any thoughts as to why
>  some of the matches are getting missed?
snip

Not off hand.  I will extract your code and do some tests.  Can you
send me your data or is it sensitive?

snip
>  Just out of beginner curiosity, why did you suggest I use the 3
>  argument filehandle instead of:
>  open(EX, "exclude1.txt") or die $!
snip

Because the three argument version of open is safer.  It doesn't
matter in the code you wrote because you used a literal string, but if
you say

open FH, $file or die "could not open $file: $!";

expecting FH to be a read filehandle and $file contains the filename
">important", you will wind up with a write filehandle.  Specifying
the type of filehandle you want separately from the file is an
important safety feature.  Using the old version of open is a bad
habit you should not develop.  You should know it exists (like many of
the other bad habits left over from earlier versions of the Language)
in case you run into code that uses it, but you shouldn't use it
yourself.  I would also strongly recommend using lexical filehandles
instead of the old bareword style for similar reasons.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to