develooper Front page | perl.beginners | Postings from December 2002

Why do these two statements generate different output?

Thread Next
From:
Paul Kraus
Date:
December 27, 2002 12:18
Subject:
Why do these two statements generate different output?
Message ID:
015301c2ade5$210ea880$64fea8c0@pkrausxp
$1 from reg expr is equal to 2300,150.17

$org = $1;
$org=~s/,//g;
Generates 2300150.17. Which is correct.

$org = $1 =~ s/,//g;
Generates 17904.

Now if I am correct the binding =~ has precedence over =. So it should
generate the same output.

Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About