Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: Comparing f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 11 Topic 11016 of 11531
Post > Topic >>

Re: Comparing files with regular expressions

by Jenda@[EMAIL PROTECTED] (Jenda Krynicky) May 3, 2008 at 10:42 PM

From:           	"Chas. Owens" <chas.owens@[EMAIL PROTECTED]
>
> On Fri, May 2, 2008 at 10:44 AM, rubinsta <rubinsztajn@[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
> ">im****tant", you will wind up with a write filehandle.

And that means you were lucky. If the $file contained something like 
"|rm -rf /" or "rm -rf / |" ...

Jenda
===== Jenda@[EMAIL PROTECTED]
 === http://Jenda.Krynicky.cz
=====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
	-- Terry Pratchett in Sourcery
 




 11 Posts in Topic:
Comparing files with regular expressions
rubinsztajn@[EMAIL PROTEC  2008-05-01 13:09:53 
Re: Comparing files with regular expressions
chas.owens@[EMAIL PROTECT  2008-05-02 07:41:47 
Re: Comparing files with regular expressions
rubinsztajn@[EMAIL PROTEC  2008-05-02 07:44:57 
Re: Comparing files with regular expressions
chas.owens@[EMAIL PROTECT  2008-05-02 19:56:47 
Re: Comparing files with regular expressions
Jenda@[EMAIL PROTECTED]   2008-05-03 22:42:10 
Re: Comparing files with regular expressions
chas.owens@[EMAIL PROTECT  2008-05-03 17:01:53 
Re: Comparing files with regular expressions
Jenda@[EMAIL PROTECTED]   2008-05-03 23:57:06 
Re: Comparing files with regular expressions
rob.dixon@[EMAIL PROTECTE  2008-05-04 01:08:19 
Re: Comparing files with regular expressions
chas.owens@[EMAIL PROTECT  2008-05-03 21:40:34 
Re: Comparing files with regular expressions
rubinsztajn@[EMAIL PROTEC  2008-05-05 09:28:52 
Re: Comparing files with regular expressions
rob.dixon@[EMAIL PROTECTE  2008-05-05 15:24:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 19:09:00 CDT 2008.