in reply to Twiddle

Why do you need all those variables? and did you check if it passes -w and strict?

here's one that does:

#!/usr/bin/perl -w use strict; print 'What string would you like to twiddle? '; chomp(my $twiddle = <STDIN>); my $string; my @t = split(//, $twiddle); for (0..$#t) { $string .= shift(@t); print $string, "\n"; # up } while ($string) { chop($string); print $string, "\n"; # and down }


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/