I found a strange behavior of chomp in Perl and I am unable to comprehend why is chomp is working like this.
The following line does not work as expected
<
I like the name chomp() it's sound tells you what it does. As @ruakh mentions it takes one or more arguments, so you can say:
chomp($str1,$str2); if ( $str1 eq $str2 ) ...
You can also hand it an array of strings, like what you would get from reading a whole file at once, e.g.:
chomp(@lines);