#!/usr/bin/perl use strict; use warnings; my $bikelock; my $zodials = 4; my $constellations = 10; $bikelock = combicracker( {}, $zodials ); print_psychle($bikelock); sub combicracker { my $ref = shift; my $zodials = shift; $ref->{ $_ } = { } for 0 .. $constellations-1; if( --$zodials ){ for my $key ( keys %$ref ){ combicracker( $ref->{ $key }, $zodials ); } } $ref; } sub print_psychle{ my $bref = shift; my $sn = shift || '0'; unless( (keys %$bref)[0] ){ $sn =~ s/\A0//; print "attempt: $sn\n" ; return; } foreach my $attempt_builder ( keys %$bref ){ my $att_b2 = $sn . $attempt_builder; print_psychle( $bref->{$attempt_builder} , $att_b2 ); } } #### attempt: 6666 attempt: 6663 attempt: 6667 attempt: 6669 attempt: 6662 attempt: 6668 attempt: 6661 attempt: 6664 attempt: 6660 attempt: 6665 attempt: 6636 attempt: 6633 attempt: 6637 attempt: 6639 attempt: 6632 attempt: 6638 attempt: 6631 attempt: 6634 ... attempt: 0073 attempt: 0077 attempt: 0079 attempt: 0072 attempt: 0078 attempt: 0071 attempt: 0074 attempt: 0070 attempt: 0075 attempt: 0096 ... attempt: 5556 attempt: 5553 attempt: 5557 attempt: 5559 attempt: 5552 attempt: 5558 attempt: 5551 attempt: 5554 attempt: 5550 attempt: 5555