#!/usr/bin/perl -w use strict; my $hint = '1234'; my @chars = ('0'..'9', 'a'..'z'); my $len = 6 - length $hint; &append (""); sub append { my $s = shift; if (length $s >= $len) { &hint($s); return; } foreach (@chars) { my $new = $s.$_; &append ($new); } } sub hint { my $s = shift; my $new; for (my $i=0; $i<=length($s); ++$i) { $s =~ m/^(.{$i})(.*)$/; $new = $1.$hint.$2; print $new."\n"; } }