![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Whatever happened to chomp?by jsprat (Curate) |
on Dec 14, 2003 at 14:57 UTC ( #314639=note: print w/replies, xml ) | Need Help?? |
2 is a number, and perl is trying to DWYM with the numerical compare (==).
in __DATA__, and change the conditional to if ($data eq '2'). Now see what effect chomp has... Update: Struck out the data section and added bit about numerical compare to the first sentence. I shouldn't have included the red herring (one, two, three). The original point was supposed to be that perl will treat a variable like a number in numerical context (== instead of eq).
In Section
Seekers of Perl Wisdom
|
|