#!/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 ); } }