Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- my @chars = ('1','2','3');
- my $len = 4;
- &generate_bystrableat;
- sub generate_bystrableat {
- my $s = shift;
- if (length $s >= $len) {
- my $new;
- for (my $i=0; $i<=length($s); ++$i) {
- $s =~ m/^(.{$i})(.*)$/;
- $new = $1.$2;
- print $new."\n";
- return;
- }
- return;
- }
- foreach (@chars) {
- my $new = $s.$_;
- &generate_bystrableat ($new);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment