in reply to Re: Get last occurence of a character in a string
in thread Get last occurence of a character in a string
(And yes, File::Basename is the way to go in this case)my $path = 'c:\\folder1\\filename.doc'; my ($file) = ($path =~ /([^\\]*)$/);
UPDATE: Corrected /([^//]*)$/ to /([^\\]*)$/, thx FunkyMonk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Get last occurence of a character in a string
by FunkyMonk (Bishop) on Aug 06, 2008 at 13:23 UTC |