Be prepared to loop for a very long time.my $num = "000"; { $num =~ s{(^|.)(z*)$}{ my ($left, $right) = ($1, $2); $left =~ tr/0-9a-y/1-9a-z/ or $left = "10"; $right =~ tr/z/0/; $left . $right; }e; print "$num\n"; redo while length $num < 20; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: Iterating through string combinations
by merlyn
in thread Iterating through string combinations
by patgas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |