in reply to getting the tail of a string

use File::Basename; my $file_name = basename($full_path);

Replies are listed 'Best First'.
Re: Re: getting the tail of a string
by sauoq (Abbot) on Jun 10, 2003 at 19:31 UTC

    As he is asking for a way to do this on the command line, I'd be inclined to offer something simple:

    my $m = $x =~ m!([^/]*)$!;

    -sauoq
    "My two cents aren't worth a dime.";
    

      And I'd be inclined to offer something that worked on my Mac OS 9 box (it's still there buzzing away in the corner :-)

      To-may-to. Toe-mah-to.