in reply to exiting a subroutine neatly
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: exiting a subroutine neatly
by SimonPratt (Friar) on May 07, 2015 at 15:10 UTC |