Re: Comparing files with regular expressions

2008-05-05 Thread Rob Dixon
Aaron Rubinstein wrote: > >> Given just the idea of the data, can you improve on that? > > I bet I could! I bet you could too :) > It's interesting how my instinct, when trying to develop a programming > solution, is to wrestle with the problem inside the context of the language. > As a result

Re: Comparing files with regular expressions

2008-05-05 Thread Aaron Rubinstein
> Given just the idea of the data, can you improve on that? I bet I could! It's interesting how my instinct, when trying to develop a programming solution, is to wrestle with the problem inside the context of the language. As a result, the solutions I come up with tend to be shaped by my limited

Re: Comparing files with regular expressions

2008-05-03 Thread Chas. Owens
On Sat, May 3, 2008 at 5:57 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: "Chas. Owens" <[EMAIL PROTECTED]> > > > On Sat, May 3, 2008 at 4:42 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > snip > > > > [stuff about how two arg open is more dangerous than three arg open > > > And that

Re: Comparing files with regular expressions

2008-05-03 Thread Rob Dixon
rubinsta wrote: > Hello, > > I'm a Perl uber-novice and I'm trying to compare two files in order to > exclude items listed on one file from the complete list on the other > file. What I have so far prints out a third file listing everything > that matches the exclude file from the complete file (

Re: Comparing files with regular expressions

2008-05-03 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > On Sat, May 3, 2008 at 4:42 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > snip > > > [stuff about how two arg open is more dangerous than three arg open > > And that means you were lucky. If the $file contained something like > > "|rm -rf /" or "rm -rf

Re: Comparing files with regular expressions

2008-05-03 Thread Chas. Owens
On Sat, May 3, 2008 at 4:42 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: snip > > [stuff about how two arg open is more dangerous than three arg open > And that means you were lucky. If the $file contained something like > "|rm -rf /" or "rm -rf / |" ... snip Nah, you would be lucky if that wer

Re: Comparing files with regular expressions

2008-05-03 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > 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 y

Re: Comparing files with regular expressions

2008-05-02 Thread Chas. Owens
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

Re: Comparing files with regular expressions

2008-05-02 Thread rubinsta
Many thanks, Chas. These are all very helpful (and educational!) suggestions. I adapted your example like so (specifying the all.txt on the command-line): #!/usr/bin/perl use strict; use warnings; open my $ex, "<", "exclude.txt" or die $!; open my $out, ">", "exTest.txt" or die $!; my %exists;

Re: Comparing files with regular expressions

2008-05-02 Thread Chas. Owens
On Thu, May 1, 2008 at 4:09 PM, rubinsta <[EMAIL PROTECTED]> wrote: > Hello, > > I'm a Perl uber-novice and I'm trying to compare two files in order to > exclude items listed on one file from the complete list on the other > file. What I have so far prints out a third file listing everything >

Comparing files with regular expressions

2008-05-02 Thread rubinsta
Hello, I'm a Perl uber-novice and I'm trying to compare two files in order to exclude items listed on one file from the complete list on the other file. What I have so far prints out a third file listing everything that matches the exclude file from the complete file (which I'm hoping will be a d