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

GwenDragon
 2014-07-23 10:04
#176551 #176551
User since
2005-01-17
14745 Artikel
Admin1
[Homepage]
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"
^Z
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 http://perldoc.perl.org/5.10.1/perlreref.html
Die existiert erst in 5.14.
Last edited: 2014-07-23 10:07:37 +0200 (CEST)

View full thread print @array (Ausgabe gruppieren)