T
Tom Gur
Hi,
is there a way for me to use a regex without assignment ?
e.g:
Lets say I have: $filepath = "/dir_a/dir_b/";
and a function: &accept_only_backslashes(); that as the name implies -
accept only backslashes
right now, the only way I can use regex to help is:
$temp = $filepath;
$filepath =~ s/\//\\/g
&accept_only_backslashes($filepath);
$filepath = $temp;
this is very ugly.
is there a way to just send the value of the substitution, without
actually changing the variable ?
Thanks,
Tom
is there a way for me to use a regex without assignment ?
e.g:
Lets say I have: $filepath = "/dir_a/dir_b/";
and a function: &accept_only_backslashes(); that as the name implies -
accept only backslashes
right now, the only way I can use regex to help is:
$temp = $filepath;
$filepath =~ s/\//\\/g
&accept_only_backslashes($filepath);
$filepath = $temp;
this is very ugly.
is there a way to just send the value of the substitution, without
actually changing the variable ?
Thanks,
Tom