roho has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; my @array = qw( a b c ); print "\nSimple join (without parens) - OK\n"; my $cols = join('],[',@array); print "cols = $cols\n"; print "\nConcatenation and join (without parens)- NOT OK\n"; $cols = '[' . join '],[',@array . ']'; print "cols = $cols\n"; print "\nConcatenation and join (with parens) - OK\n"; $cols = '[' . join('],[',@array) . ']'; print "cols = $cols\n";
"Its not how hard you work, its how much you get done."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Join and Concatenation
by toolic (Bishop) on Sep 13, 2013 at 18:03 UTC | |
|
Re: Join and Concatenation
by LanX (Saint) on Sep 13, 2013 at 18:31 UTC | |
|
Re: Join and Concatenation
by ricDeez (Scribe) on Sep 14, 2013 at 00:53 UTC |