in reply to Extract middle string from a path using RegExp

Like I said in the CB,

my $base = 'C:\\fldr1\\fld2\\'; $str =~ s/\@\@.*//s; $str =~ s/^\Q$base\E//;

or better yet

use File::Spec::Functions qw( abs2rel ); my $base = 'C:\\fldr1\\fld2'; $str =~ s/\@\@.*//s; $str = abs2rel($str, $base);

Replies are listed 'Best First'.
Re^2: Extract middle string from a path using RegExp
by dani_cv (Acolyte) on Sep 06, 2008 at 17:03 UTC
    Thanks a lot everyone...