hi yeah, i have started to write the code but am having troubles with the
various operators around the search bit, anyway here goes:

my ($file_name, $search_string) = @ARGV;

open(INFILE, "< $file_name");

while (<INFILE>) {

if ($_ =~ $search_string) {

print "yes\n";

exit();

}

}

print "no\n";



Thanks for your help

"R. Joseph Newton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Matt O'neill wrote:
>
> > Hi guys,
> >
> > I need a very simple command line perl program that takes two
arguements,
> > the frist being a filename and the second being a word to be searched
for in
> > that file.  Then I simply want the result to print "yes" if arg2 is
found,
> > or "no" if it is not.
> >
> > Thanks for your help
> >
> > matt.
>
> Hi Matt,
>
> It's great to hear that you are getting started in your programming
studies!  When you get your script written, and test it by trying to run it,
write back with the code and the results.  You will find many people happy
to help you move forward in your efforts.
>
> Joseph
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to