Debraj Bhattacharyya wrote:
>
> Hi
Hello,
> I am facing a problem .In one script ,it asks the user to enter a filename ,where
> the whole path can also be entered.For Example :
>
> Enter the FILENAME : /usr/bin/xyz.sql
>
> My question is how to separate the directory path from the filename ,store it in
> different variables and then go to that particular directory to look for the file ?
perldoc File::Basename
But there is no need to go to that particular directory to look for the
file just use -e with the full path.
my $filename = '/usr/bin/xyz.sql';
if ( -e $filename ) {
print "$filename exists\n";
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]