in reply to Doubt regarding find and grep command

I am not able to determine what exactly your problem is. From your first sentence I read: you have a given file name and want to find that file at a specific location (which I assume is a directory). If you just want that, you can use Perl's file test operator and avoid external calls to find and grep completely (see file test ops).

Like this

use strict; use warnings; if (-f '/pptai/nightly_db/data_loader_logs/2010-06-18_AIX_nightly_data +_loader.log') { # file exists ... } else { # file does not exist as a plain file }
If you want to check if the given file name is listed in a line of some other text file, you can use a simple loop for that. The file is read line by line until the file name is found or the text file has been read completely.
use strict; use warnings; my $searchstring = '/pptai/nightly_db/data_loader_logs'; open my $rfh, '<', '2010-06-18_AIX_nightly_data_loader.log' or die "ca +nnot open file:$!\n"; while (defined($_ = <$rfh>)) { if (0 <= index $_, $searchstring) { # file name is part of the current line print ; last; } } close $rfh or die "cannot close:$!\n";