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 =~ /(.*)\/(.*)) { $Path = $1; $file = $2; } since the first .* is greedy, this will take the entire path up top the final delimiter. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]