Nishi Bhonsle wrote:
> Hi:

Hello,

> I have a string such as
> instance/bit/bitGroup/default/tz/l_cs
> where the last directory stands for os languages.
> 
> I have to get the last directory and assign it to a var such as
> $mylang = l_cs, in the above example.
> How can i achieve that?

$ perl -le'
use File::Basename;

my $string = "instance/bit/bitGroup/default/tz/l_cs";
my $mylang = basename $string;
print $mylang;
'
l_cs



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to