Perl 5, 42 bytes
40 bytes plus two for the
-lF flags (
-M5.01 is free):
perl -lF -M5.01 script.pl
-lFreads the input, removes the trailing newline, puts the remainder into the string
$_, splits it up into characters, and puts that split into the array
$`equal to the stuff before it and
$'equal to the stuff after it.
"$'$`"is thus the number of times to rotate the array.
- Now for every element of the list from
"$'$`", we rotate the array (
popthe last element and
unshiftit onto the beginning).
- After the loop exits, we
sayall the elements of the rotated array.