(I also took the liberty of removing the blank line at the end, which I assumed unintentional)#!/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);
In reply to Re: Twiddle
by ariels
in thread Twiddle
by Siggy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |