in reply to Getting the filename from full path name ?
I'm sure that someone can whittle that down by quite a bit, but it was a fun diversion...:)$a = "foo/bar/baz"; my $pos = my $save_pos = 0; do { $pos = index($a, "/", $pos + 1 ); $save_pos = $pos if $pos != -1; } while ($pos != -1); print substr($a, $save_pos + 1);
thor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting the filename from full path name ?
by duff (Parson) on Apr 15, 2004 at 03:48 UTC | |
|
Re: Re: Getting the filename from full path name ?
by BUU (Prior) on Apr 15, 2004 at 03:47 UTC | |
|
Re: Re: Getting the filename from full path name ?
by pbeckingham (Parson) on Apr 15, 2004 at 03:49 UTC | |
by tachyon (Chancellor) on Apr 15, 2004 at 05:14 UTC | |
by Anonymous Monk on Apr 15, 2004 at 05:01 UTC |