Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: How do I add commas to a number?by Dodger (Novice) |
on Jan 21, 2015 at 22:35 UTC ( [id://1114070]=note: print w/replies, xml ) | Need Help?? |
I know it's eons old but I just noticed this (when looking for if there was some easy one-liner for this); it's good that that was removed from that FAQ mentioned above in the first answer. Since return() casts in list context: return reverse $input;will not work (at least not as expected), as it reverses the list of the result, e.g. ('098,765,432,1') to ('098,765,432,1') (it's a list of one). What you'd need is: return scalar reverse $input;
In Section
Seekers of Perl Wisdom
|
|