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 }
In reply to Re: Twiddle
by Chady
in thread Twiddle
by Siggy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |