Jul 17, 2014, 4:15 PM
Post #4 of 4
I don't have time to rewrite your code, but I can give you some suggestions.
Re: [chazzquire] Ping Script - Perl.exe Crashing
[In reply to]
Most of the code in each of those 3 subs is exactly the same and only a few lines in each are specific to the given task. Extract that common code and put it into a new sub lets call it test() which will act as a wrapper for those test subs. Instead of calling TCPPingTest() you call the wrapper sub and pass it the type of test to preform and it will call the appropriate test sub.
Making this script platform independent will be problematic if you are using threads. Perl is not thread safe on Windows. Newer versions have better thread support, but they are still problematic. The code you posted isn't making use of threads other than loading the pragmas, but if your running code does, then that could be the cause of the crashes.