[wplug] perl / cron problem

Mike S lists at immuneit.com
Fri Oct 21 16:13:37 EDT 2005


> This seems like a rather pointless function.  Why don't you replace any
> run(...) functions with "system(...) == 0 or die ...".  Also, "my @args
> = shift" only puts the first argument in @args, so you're only running
> system with the first parameter passed to run().  You're probably
> running the run(...) function with only one parameter, so you haven't
> encountered any problems yet.

That is the case, and I really like my code better with:
run('tar czvf xyz abc');
rather than
system('tar czvf xyz abc') == 0 or die ('error:  What do you know...');
because its a lot easier to type.

> You could have it store and print the exit status of the system()
> command, to see what the return value of it was.

I am going to give that a whirl.  Does system return an integer?


> The fact that you're using 'cygwin' will probably add all sorts of
> strangeness.  How does cygwin run cron?  does it do the right thing to
> pass on ssh agent env variables?

Cygwin behaves pretty well.  It runs cygwin as a service.  Its not too
weird as far as I can tell.  Cron executes like clockwork.  Sshd runs
fine.  I wouldn't use it in a "production" environment, but when you have
to use Windows, it beats cmd.exe all to hell.



More information about the wplug mailing list