Win8 Strawberry 5.8.9.5 (32) Wed 04/07/2021 21:57:03
C:\@Work\Perl\monks
>perl -Mstrict -Mwarnings -l
my $value = 1 x 131;
print 'A: ', $value;
my $value1 = $value / 1;
print 'B: ', $value1;
^Z
A: 1111111111111111111111111111111111111111111111111111111111111111111
+111111111111111111111111111111
1111111111111111111111111111111111
B: 1.11111111111111e+130
See perlop for precedence
(update: and associativity, which is the critical
consideration in this case)
of x (string) and /
(numeric) operators.
Update: Another way to look at it:
Win8 Strawberry 5.8.9.5 (32) Wed 04/07/2021 21:58:47
C:\@Work\Perl\monks
>perl -Mstrict -Mwarnings -l
my $value = 1 x (131 / 1);
print 'C: ', $value;
^Z
C: 1111111111111111111111111111111111111111111111111111111111111111111
+111111111111111111111111111111
1111111111111111111111111111111111
(Sorry about the wrap-around. :)
Give a man a fish: <%-{-{-{-<
|