Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String match does not work with '+' sign?

Status
Not open for further replies.

whn

Programmer
Oct 14, 2007
265
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!!
 
Thanks! Somehow, I cannot add a star. Don't know why. Could the link be broken?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top