Was googling and found an old sub of mine I thought might be appreciated. Enjoy.
use strict; use warnings; sub rotate {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} @ARGV = qw/y s t h/ unless @ARGV; print "@{ rotate $_, \@ARGV }\n" for -5..5;