molecules has asked for the wisdom of the Perl Monks concerning the following question:
is the same asuse v6; my @array = (1) xx 5;
You can achieve the same thing in Perl5 using x (thanks kennethk and ikegami):use v6; my @array = (1, 1, 1, 1, 1);
I previously thought that x only created strings.#perl5 my @array = (1) x 5;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there a Perl5 module on CPAN that provides a function analogous to the Perl6 list-repeat operator?
by ikegami (Patriarch) on Aug 11, 2010 at 15:28 UTC | |
|
Re: Is there a Perl5 module on CPAN that provides a function analogous to the Perl6 list-repeat operator?
by kennethk (Abbot) on Aug 11, 2010 at 15:18 UTC |