Sep 2, 2011 #1 whn Programmer Joined Oct 14, 2007 Messages 265 Location US Code: my $a = 'San+Francisco'; my $b = 'San+Francisco'; if($a =~ $b) { print "Match: #$a#, #$b#\n"; } else { print "Not Match: #$a#, #$b#\n"; } Test run: % ./tt.pl Not Match: #San+Francisco#, #San+Francisco# You help is highly appreciated!!
Code: my $a = 'San+Francisco'; my $b = 'San+Francisco'; if($a =~ $b) { print "Match: #$a#, #$b#\n"; } else { print "Not Match: #$a#, #$b#\n"; } Test run: % ./tt.pl Not Match: #San+Francisco#, #San+Francisco# You help is highly appreciated!!
Sep 2, 2011 #2 feherke Programmer Joined Aug 5, 2002 Messages 9,541 Location RO Hi The "+" sign gets interpreted as quantifier meaning character "n" one or more times. man perlre said: [tt]\Q quote (disable) pattern metacharacters till \E[/tt] Click to expand... Code: [navy]$a[/navy] [teal]=~[/teal] [green][i]"\Q$b\E"[/i][/green] Feherke. http://free.rootshell.be/~feherke/ Upvote 0 Downvote
Hi The "+" sign gets interpreted as quantifier meaning character "n" one or more times. man perlre said: [tt]\Q quote (disable) pattern metacharacters till \E[/tt] Click to expand... Code: [navy]$a[/navy] [teal]=~[/teal] [green][i]"\Q$b\E"[/i][/green] Feherke. http://free.rootshell.be/~feherke/
Sep 2, 2011 Thread starter #3 whn Programmer Joined Oct 14, 2007 Messages 265 Location US Thanks! Somehow, I cannot add a star. Don't know why. Could the link be broken? Upvote 0 Downvote