in reply to Twiddle
There's also a simple regex solution to that ;-)
#!/usr/bin/perl -w use strict; print 'What string would you like to twiddle? '; chomp(my $twiddle = <STDIN>); $twiddle =~ /^(.+?)(?{print $1,"\n";})$/; # up chop($twiddle); $twiddle =~ /^(.+)(?{print $1,"\n";})^/; # down
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Twiddle
by petral (Curate) on Jul 12, 2001 at 21:27 UTC | |
by Siggy (Novice) on Jul 13, 2001 at 04:34 UTC |