in reply to Regex Improvement
The initial File::Spec->catfile call appends a trailing '\' so that it doesn't show up as an initial '\' in the resulting $' that you pass to File::Spec->splitpath.$pat = File::Spec->catfile($HomePath, ''); if ($Model =~ m/^\Q$pat\E/i) { (undef,$WorkingDirectory,undef) = File::Spec->splitpath($'); } else { # whatever to do if the supplied variable isn't under $HomePath }
|
|---|