Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Perl SSH2

by sparkyichi (Deacon)
on Jul 22, 2013 at 17:54 UTC ( #1045694=note: print w/replies, xml ) Need Help??

in reply to Perl SSH2

The script looks okay to me. If "stopservices" is not running you need to look at how you are calling it in the larger script.

I would add a print line just after "sub stopservices {" to make sure that it is not running. Then look into how you are calling it.


Replies are listed 'Best First'.
Re^2: Perl SSH2
by PilotinControl (Monk) on Jul 22, 2013 at 19:09 UTC

    In further review the stand alone script performs the function and the script windows exits after the " sleep 5; " function in the larger program the sub routine does not close down as the main program stays on to perform other functions. I need the " sub stopservices " to exit. In that case a while loop would be needed? Or should I head in a different direction? Thoughts?

      Can you provide more detail about the main script?

      How do you know stopservices is running and hasn't been skipped?

      If you need to get out of a sub you can use "return($var)" to return to the calling routine.


        It was a simple fix it seems $chan->blocking(0); was keeping the script from properly executing a command. Thanks for the input it made me look closer at the code in depth instead of just surface.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045694]
[Discipulus]: yees.. masonry, shaving of the ceiling (dunno if shaving is the right term..) 20hours in the weekend.. so veery good ;=)
[LanX]: yes I worked ...
[LanX]: ... and hope to get a free work day in compensation. :)
choroba went to a museum with the older children. The exhibition was called "American Indians".
[Discipulus]: this and...
[Discipulus]: shaving the ceil

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2018-02-19 10:26 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (261 votes). Check out past polls.