Q:

How to put repeating number on range operator perl

Hi guy's i hv a question about range operator in perl
my simple scripts
@nums = (111..444);print "@nums\n";

how do i make the output like 
111 222 333 444

A:

If you do not need the other numbers in between at all, but want to have an array that has the repeating ones as described, the easy and elegant way could be:
@nums = map {$_ x3} 1..4;

have fun

A:

Two alternative solutions. One, perhaps, more readable than vanHoesel's:
@nums = map { $_ * 111 } 1 .. 4;

And another which is really inefficient and ridiculous:
@nums = grep { ! ($_ % 111) } 111 .. 444;

Please don't use the second one :-)

