Hi:

In case the string i am looking for is secondlast position as in

instance/bit/bitGroup/default/tz/l_cs/messages

How can i change the manip code to get l_cs in this case?

Thanks!


On 2/16/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
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/




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


Reply via email to