For your purpose,using Perl's built-in module File::Basename is a good way.

use File::Basename;
my $filename = basename($topdir);
my $dirname = dirname($topdir);

Good luck!


2007/4/19, Nishi <[EMAIL PROTECTED]>:

Hi:

I am using the following reqular expression to extract the last part ie
$lang of the following string
$topdir = "common/default/l_cs";
my $lang=$topdir =~ /.*\/(.+)$/;

But it doesnt seem to work, what am i missing here?

Thanks!




--
mailto: [EMAIL PROTECTED]
http://home.arcor.de/jeffpang/

Reply via email to