http://qs321.pair.com?node_id=456350


in reply to Handling both string and numeric comparisons

You can force the numeric context for your string in the following fashion:
if (0 + $param == 5) { ... }
This will execute and provide the comparison operation that you desire without error or warning. Where $param is a string, the result of the inner operation is zero.

 

perl -le "print unpack'N', pack'B32', '00000000000000000000001000000000'"