Hin und wieder verblüfft mich Perl doch noch. Es geht ja an dass es einen flip flop operator
... und den yada-yada operator
... gibt. Aber warum wird hier
... als Zahlenbereich interpretiert?
~/devel/Perl/snippets$ cat three_dots.pl
use strict;
use warnings;
my @arr = 1 ... 10;
print "@arr";
~/devel/Perl/snippets$ perl -MO=Deparse three_dots.pl
use strict;
use warnings;
my(@arr) = 1..10;
print join($", @arr);
three_dots.pl syntax OK
Dass im Listenkontext ... dasselbe wie .. ist, ist in
https://perldoc.perl.org/perlop#Range-Operators dokumentiert. Aber trotzdem.
Last edited: 2025-01-09 14:35:27 +0100 (CET)