K.Prabakar wrote:
Anish Kumar K. wrote:
$openTag='\[%';
$closeTag='%\]';
my $count=0;
$_= "This is a test for [%one_two%] number and [%pne%] numbers.";
s/$openTag.*$closeTag/New/g;
Within single quotes "[" is not considered as a special character.
So,it's a mess trying to escape this character with backslash "\".
No it's not.
So,your code expects \[%one_two%\] instead of [%one_two%].
No it doesn't. '[' and ']' are used in a regular expression where
those characters are special.
How about testing before posting such a comment?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>