Danny Fang wrote: > Hi > I'm a newbie in PERL and wish to seek some help with regards to > pattern matching PERL and grep.
Hi, and welcome. First, "perl" is the interpreter for the "Perl" language. "PERL" is considered gauche. :~) > > I would like the script to do the following: [ snip specification ] > Could anyone help me out by showing an implementation of a PERL > script to automate this task? Attached is the Java source file, which > is to be read as the input. The list isn't a script writing service. I can point you to one if you need one. Here's some tips if you're interested in doing it yourself: If you want to find lines containing 'double' or 'parseDouble' using grep(1), you can do something like: grep -e 'double|parseDouble' *.java The perl equivalent is: perl -ne 'print if /double|parseDouble/' *.java Look at the following docs: perldoc perlrun (look at -n switch) perldoc perlvar (look at @ARGV, $ARGV, $.) perldoc perlop (search for the string "The null filehandle") HTH, Bob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>