in reply to Re: Perl 6 - Operator renaming
in thread Perl 6 - Operator renaming
most languages (that I know) use the + for both
Yes, but other languages don't have Perl's notion of context. In Perl, the + operator supplies numeric context, but the concatenation operator supplies string context. The difference can be important.
my $barcode_prefix = "25728"; for my $b (@series) { my $chkd = checkdigit($barcode_prefix . $b); }
If you change the concatenation operator there to +, a completely different thing happens and the check digit comes out wrong. (And yes, I have written code that calculates barcode check digits in Perl5.)
|
|---|