use B qw(class svref_2object); $\ = "\n"; my $rand = rand; $bar = sub { print $rand }; while (1) { mutate( $bar ); $bar->(); sleep 1; } sub mutate { (svref_2object($_[0])->PADLIST->ARRAY)[1]->object_2svref->[1] = rand }