Thread print @array (Ausgabe gruppieren) (15 answers)
Opened by Robin G. at 2014-07-22 16:08

 2014-07-23 10:04
#176551 #176551
User since
14422 articles
user image
PERL-5.10 U:\>perl
use strict; use warnings;
my @array = 1..100;
print join(", ", @array) =~ s/(\d+, ){3}/$&\n/gr;
Bareword found where operator expected at - line 3, near "s/(\d+, ){3}/$&\n/gr"
Can't modify join or string in substitution (s///) at - line 3, near "s/(\d+, ){3}/$&\n/gr"
syntax error at - line 3, near "s/(\d+, ){3}/$&\n/gr"
Execution of - aborted due to compilation errors.

Die Option r bei Regex gibt es in Perl 5.10.1 nicht. Siehe
Die existiert erst in 5.14.
Last edited: 2014-07-23 10:07:37 +0200 (CEST)
die Drachin, Gwendolyn

Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread print @array (Ausgabe gruppieren)