Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Variable Substitution Question
ReggieRWalker
ENV: TS 6.5 sp3 | Win Server 2K3 Ent.
This *should* work...so I need another pair of eyes please:
------------------------------------------------------------------
# Get Passed In Variables
my $wf_template = $ARGV[0];
my $filename = $ARGV[1];
my $workarea = $ARGV[2];
$filename =~ s|$workarea||;
------------------------------------------------------------------
If $filename = /this/is/the/dir/name and $workarea = /this/is/the/dir, then I would think that this:
$filename =~ s|$workarea||;
would result in /name. Or am I totally whacked?
TIA
Find more posts tagged with
Comments
nipper
try =~ s|\Q$workarea||;
nipper
Also, you will be getting the workarea-relative path, not the specific filename.
so if the path was /d/m/foo/WA/mine/some/dirs/bar.html
and you are passed /d/m/foo/WA/mine/ then you are left with some/dirs/bar.html
just an FYI,
ReggieRWalker
Thanks Nipper. That worked perfectly.