Case 1)
my $VAR = 'ABC@VERSION@DEF' ;
$VAR =~ s/\@VERSION\@/1.2.3.4/g ;
print "<$VAR>\n" ;
Prints <ABC1.2.3.4DEF> as expected.
=========================
Case 2)
Lets say $input_file has a line containing ABC@VERSION@DEF
And I want to replace @VERSION@ by 1.2.3.4 So I do:
`perl -pe 's/\@VERSION\@/1.2.3.4/g' -i $input_file` ;
Which chnages the content in $input_file to
ABC1.2.3.4VERSION1.2.3.4DEF
Why the difference in the two cases ?
What do I need to do to get bahavior like Case 1 in Case 2 ?
I'd suspect some special interpretation of @ at play but it's escaped - but
not sure any ideas ?
Thanks!