in reply to Changing value passed to sub

You could use references to achieve this.

. . . my_sub(\$handle); . . . sub my_sub{ my $handle = shift; if (handle_not_valid($$handle)){ $handle = \(new_handle()); } ... }

Regards,

PN5