Re: How to reinvent grep in perl?

2007-10-08 Thread Chas. Owens
On 10/8/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: "Chas. Owens" <[EMAIL PROTECTED]> > > On 10/3/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: > > snip > > > Chas shows one possibility. However, that approach generally involves > > > slurping the entire file into the perl script, applyin

Re: How to reinvent grep in perl?

2007-10-08 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > On 10/3/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: > snip > > Chas shows one possibility. However, that approach generally involves > > slurping the entire file into the perl script, applying the regex to > > the whole thing, and then spitting the result

Re: How to reinvent grep in perl?

2007-10-05 Thread John W. Krahn
on rewriting grep in perl so that it ignores the contents of /* and */ comments? Instead of rewriting grep, consider writing a comment filter. Have it read from standard input and write to standard output; pipe the file that you want to grep into it, and pipe its output into grep. Thanks, but if

Re: How to reinvent grep in perl?

2007-10-04 Thread Jonathan Lang
siegfried wrote: > Thanks, but if I am piping from stdin to stdout I see two problems: > > (1) how do I implement the -n flags that tell me the line number and > file name where the matches are Well, as long as you're only piping one file at a time, the line number part isn't a problem; but I see

RE: How to reinvent grep in perl?

2007-10-04 Thread siegfried
> >siegfried wrote: >> I need to search large amounts of source code and grep is not doing the job. >> The problem is that I keep matching stuff in the comments of the >> C++/Java/Perl/Groovy/Javascript source code. >> >> Can someone give me some hints on wher

Re: How to reinvent grep in perl?

2007-10-03 Thread Chas. Owens
On 10/3/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: snip > Chas shows one possibility. However, that approach generally involves > slurping the entire file into the perl script, applying the regex to > the whole thing, and then spitting the result out again. From what I > understand, this genera

Re: How to reinvent grep in perl?

2007-10-03 Thread Jonathan Lang
siegfried wrote: > I need to search large amounts of source code and grep is not doing the job. > The problem is that I keep matching stuff in the comments of the > C++/Java/Perl/Groovy/Javascript source code. > > Can someone give me some hints on where I might start on rewriting gr

Re: How to reinvent grep in perl?

2007-10-03 Thread Chas. Owens
ints on where I might start on rewriting grep in > perl so that it ignores the contents of /* and */ comments? snip perldoc -q comments will get you halfway there -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to reinvent grep in perl?

2007-10-03 Thread jm
me some hints on where I might start on rewriting grep in > perl so that it ignores the contents of /* and */ comments? > > Thanks, > Siegfried > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.

How to reinvent grep in perl?

2007-10-03 Thread siegfried
I need to search large amounts of source code and grep is not doing the job. The problem is that I keep matching stuff in the comments of the C++/Java/Perl/Groovy/Javascript source code. Can someone give me some hints on where I might start on rewriting grep in perl so that it ignores the

RE: grep in perl

2004-07-16 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Help a perl newbie coding for a bioinfo guy please. > > I have a shell script that contains the following code > > # $1=sequence_file, $2=input_file, $3=output file, $4=chain. > > if [ $# != 4 ] > then > echo "Usage: parse_pdb.sh sequence_file pdb_file output_f

Re: grep in perl

2004-07-15 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: Help a perl newbie coding for a bioinfo guy please. You appear to have misunderstood the purpose of this list. It's *not* a "write my Perl program for me for free" list. If you want to learn Perl: http://learn.perl.org/ If you want somebody who does the work for you:

grep in perl

2004-07-15 Thread mk76
Help a perl newbie coding for a bioinfo guy please. I have a shell script that contains the following code # $1=sequence_file, $2=input_file, $3=output file, $4=chain. if [ $# != 4 ] then echo "Usage: parse_pdb.sh sequence_file pdb_file output_file chain" exit fi TEMP_FILE=$$;

Re: using grep in perl

2004-02-03 Thread Jeff 'japhy' Pinyan
On Feb 3, Cy Kurtz said: >I'm trying to write a little program to take all of the fun out of the >daily jumble. > >My plan is to get a sequence of letters from the user, move the letters >around and bounce the resulting sequence of letters off of a spell check >dictionary until the program generat

Re: using grep in perl

2004-02-03 Thread Rob Dixon
Cy Kurtz wrote: > > I'm trying to write a little program to take all of the fun out of the > daily jumble. > > My plan is to get a sequence of letters from the user, move the letters > around and bounce the resulting sequence of letters off of a spell check > dictionary until the program generates

Re: using grep in perl

2004-02-03 Thread Andrew Gaffney
Cy Kurtz wrote: I'm trying to write a little program to take all of the fun out of the daily jumble. My plan is to get a sequence of letters from the user, move the letters around and bounce the resulting sequence of letters off of a spell check dictionary until the program generates an English wor

using grep in perl

2004-02-03 Thread Cy Kurtz
I'm trying to write a little program to take all of the fun out of the daily jumble. My plan is to get a sequence of letters from the user, move the letters around and bounce the resulting sequence of letters off of a spell check dictionary until the program generates an English word. When I call