in reply to •Re: Simple Regex needed
in thread Simple Regex needed

Just for completeness, the way I've been doing it (because I didn't know about File::Basename either) is this:
my ( $basename ) = reverse split /\//, "/tmp/app/foo";

Now I'm going to go back and change my code to use File::Basename. Thanks, merlyn!

--
Spring: Forces, Coiled Again!

Replies are listed 'Best First'.
Re: Re: •Re: Simple Regex needed
by arthas (Hermit) on May 11, 2003 at 13:32 UTC
    > my ( $basename ) = reverse split /\//, "/tmp/app/foo";

    The only problem with this is that it's not portable: it'll work on Unix, but probably not on MS Windows.