{ my %state; sub recursive { my $arg = shift; ... if( ( $arg = $state{ $arg } ) == ... ) { return recursive( $arg ); else { return 0 } } }