in reply to Re^2: Schedule::Cron process name?
in thread Schedule::Cron process name?
You're right - $0 is set in Schedule::Cron's run method. And, unfortunately for you, that method is a behemoth method which does not give you a lot of flexibility to change anything about it. For example, if you were to derive your own package from S::C, you'd have to pretty much copy and paste the entire method to your own module, minus the one line that sets $0. And then, if a new version of S::C came out with a fix, you'd have to notice and merge the fix manually. That's kinda annoying.
Instead, what I would suggest you do is take the S::C module, change the line that says $0 = ... to say $self->set_process_title(), add a new method called set_process_title that all it contains is the old $0-setting line, take a diff between what you have and the original, and submit it back to the author of S::C as a patch.
Once you have that, then you can create your own Schedule::Cron::NoProcessTitleChange, which @ISA Schedule::Cron, and overrides set_process_title with an empty function (i.e., it does nothing). Then you'll get what you are looking for.
Assuming, of course, that the author likes the patch... though, since we're not actually changing real behaviour, s/he should be fine with, I hope.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Schedule::Cron process name?
by bowei_99 (Friar) on Jun 19, 2006 at 23:24 UTC |