Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to make Perl script run automatically?

by Discipulus (Canon)
on Jul 04, 2014 at 07:36 UTC ( [id://1092252]=note: print w/replies, xml ) Need Help??


in reply to How to make PERL Script run Automaticly?

seems a duty for cron more than for Perl.

If you dont like this simple solution you can write a service, even if i think you dont need it.
The simplest one is something like:
perl -e 'while(1){do_something;eventually_sleep_sometime;}' &
Id est: run in background a program that run infinitely. But consider you have to instruct your OS to run also at boot, you need to manage signals, you have to keep running only one instance of it...

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: How to make Perl script run automatically?
by David92 (Sexton) on Jul 04, 2014 at 07:41 UTC
    Thanks for this! Yes, cron seems the simplest, although, I do not have some rights to access cron in here. SO I have to find alternatives. I will test your idea
      Speak to your friendly sysadmin and convince him to add your script to the crontab list.

      The alternative is that you run a script for a looooong period, most of the time doing nothing and that will use some resources that perhaps may be better used elsewhere.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics
      If so start reading this doc and this post too.

      HtH
      L*
      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1092252]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found