[Belfast-pm] unshift-y bop-op-op-op, just blows me away </hair>

Andrew Wilson andrew-belfastpm at rivendale.net
Thu Dec 23 08:40:48 CST 2004


On Thu, Dec 23, 2004 at 02:25:21PM +0000, Marc wrote:
> Yo, people.
> 
> This is annoying me. A better way please?
> 
> perl -e '@l = (1..10); do { warn join(" ", @l), "\n"; unshift @l, pop @l; } for (0 .. 10);'

Better? I can do it with less keystrokes, better is left as an exercise
for the reader.

perl -e '@l = 1..10; do { warn  "@l\n"; unshift @l, pop @l; } for 0..10;'
 
> Which also leads me to say: Does anyone still use 'foreach'? I can't say
> I have used it in yonks. I never even think of it.

Nope, not me.

> Oh, and 'appy Christmas.

And yourself.

andrew
-- 
Virgo: (Aug. 23 - Sept. 22)
You'll wake from dreams of eating a giant marshmallow to find
you've axe-murdered six people in your sleep, but the two things
don't seem to be related.


More information about the Belfast-pm mailing list