in reply to Twiddle

Why chop? Do you really hate substr so much??
#!/usr/local/bin/perl -w use strict; print "What string would you like to twaddle? "; chomp(my $twiddle = <STDIN>); $l = length $twiddle; # Up... print substr($twiddle,0,$_),"\n" for (1..$l); # Down... print substr($twiddle,0,-$_),"\n" for (1-$l..-1);
(I also took the liberty of removing the blank line at the end, which I assumed unintentional)