This works:
$content =~ s/(href\s*=\s*["'])($base(.*?))(["'])/
$1http:\/\/$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}
\?URL=$2&HEADER=$header$4/gis;
This doesn't:
$content =~ s/(href\s*=\s*["'])($base(.*?))(["'])/
$1http:\/\/$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}
\?URL=&url_encode($2)&HEADER=$header$4/egis;
I need to run url_encode() on one of the matches, but I get a "bareword where operator expected near '$1http'". I'm guessing that using the /e switch requires the entire right side to be a statement? I've checked the docs and can neither confirm nor disconfirm this hypothesis. If that is the case, then how can I do a replace with both string components and function components like I want?
Sincerely,
Tom Anderson
CEO, Order amid Chaos, Inc.
$content =~ s/(href\s*=\s*["'])($base(.*?))(["'])/
$1http:\/\/$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}
\?URL=$2&HEADER=$header$4/gis;
This doesn't:
$content =~ s/(href\s*=\s*["'])($base(.*?))(["'])/
$1http:\/\/$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}
\?URL=&url_encode($2)&HEADER=$header$4/egis;
I need to run url_encode() on one of the matches, but I get a "bareword where operator expected near '$1http'". I'm guessing that using the /e switch requires the entire right side to be a statement? I've checked the docs and can neither confirm nor disconfirm this hypothesis. If that is the case, then how can I do a replace with both string components and function components like I want?
Sincerely,
Tom Anderson
CEO, Order amid Chaos, Inc.