> > 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

Or you could do:

$file = $1
  if $filepath =~ /\/([^\/]*)$/;

 -dave



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

Reply via email to