in reply to Function over all letters in a string
use strict; use warnings; for (1..5) { my $string = q{It's a cat and mouse game.}; my $i = length($string) + 1; CHAR: while ($i--) { for my $c (substr($string, $i, 1)) { next CHAR unless $c =~ /^[a-zA-ZäöüßÄÖÜ]$/; # do whatever you want here $c .= $c x rand(7); } } print $string, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Function over all letters in a string
by allolex (Curate) on Dec 01, 2003 at 07:48 UTC | |
by Beechbone (Friar) on Dec 01, 2003 at 23:48 UTC |