> I have a string for example:
>
> "directory/subdirectory/subsubdirectory/filename.gz"
> 
> How do I extract the filename.gz part for testing,
> the number of subdirectories is not fixed?

use File::Basename;

my $file = "directory/subdirectory/filename.gz";
print basename($file);

Jonathan Paton



__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to