R. Joseph Newton wrote: > debraj bhattacharyya wrote: > >> Hi >> 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 ? >> >> Thanx >> Raj > > Try: > > if ($fullPath =~ /(.*)\/(.*)) {
if ( $fullpath =~ /(.*)\/(.*)/ ) { > $Path = $1; > $file = $2; > } or my ( $path, $file ) = ( $fullpath =~ /(.*)\/(.*)/ ); Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]