Welcome to the Monastery | |
PerlMonks |
Re^2: ppkby northwind (Hermit) |
on Apr 18, 2005 at 13:45 UTC ( [id://448857]=note: print w/replies, xml ) | Need Help?? |
This post is actually in reply to both previous comments (merlyn's and graff's). There is nothing quite like posting your code to an open forum to make you write better code... :) Thank you for your comments. The o in m//o was something I pulled from Programming Perl, 3rd edition. It is supposed to give a hint to the regexp compiler that the regexp only needs to be compiled once. I suppose the same thing could be achieved with qr//. Also, good catch on blindly using $1. I can see how, in a general purpose setting, -9ing a process would be a Very Bad Thing. This is the first thing on the bug list. As for systeming out for kill instead of using the built-in, does the built-in allow you access to the error codes? Also, because the code was already system dependent (ps -eaf), I figured why not add some more (sort of like using $& and friends in a regexp). The world in which I work/play/code consists of Solaris, Irix, and Fedora Core 2. So within my admittedly small world, the code works. I will be updating the above code over the next day or two (as time permits) to fix your observations of what is wrong. BTW, does anyone know where there is a list of all the strings $^O could contain?
In Section
Code Catacombs
|
|