To search inside a file, I believe you must open that file.
Try this :-
#!/usr/bin/perl -w
open (FILE, "yourfile.any_ext");
@getdata = <FILE>;
print "content-type: text/plain\n\n";
if (grep /yourmatch/, @getdata) {
print @getdata;
} else {
print "Sorry ! couldn\'t find your match in the file.\n";
};
----- Original Message -----
From: "Rajeev Nalluri" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 09, 2001 12:48 AM
Subject: grep command
>
> Is there any grep commandto search inside a file? perldoc grep gives a
grep
> command on a string, not files.
>
> And also I cannot use either backticks or system to use unix grep command.
> I want to know is there any perl function to handle grep in a file.
>
> Regards,
> Rajeev Nalluri
>
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]