Is there a better way to execute the exit, close and then the return instead of writing them after every statement to get out of the subroutine ? kr
No
You could write <c> ... sshExitClose( $ssh ); return 2; ... sshExitClose( $ssh ); return 3; ... sub sshExitClose { $_[0]->exit_session; $_[0]->close_session; }
But thats not exactly any better than the way you have it already
In reply to Re: exiting a subroutine neatly
by Anonymous Monk
in thread exiting a subroutine neatly
by Mavebe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |