Hrrmmm....

When I do this:

  @x = 1..10;
  print "@x\n";
  @y = rotate @x;
  print "@y\n";

I get:

1 2 3 4 5 6 7 8 9 10
3 4 5 6 7 8 9 10 2

It ate the "1". Is that what you wanted?

Wouldn't this work better?

  sub rotate { push @_, shift; return @_ }

I'm sure there is a way to do it with less resource consumption, but I'll
leave that to the golfers.

-QM

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 30, 2002 9:28 AM
To: [EMAIL PROTECTED]
Subject: Maybe-useful subroutine


sub rotate { unshift @_, splice @_, shift @_; return @_ }

-- 
Kevin Reid

Reply via email to