Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > variable running once

Reply
Thread Tools

variable running once

 
 
lerameur
Guest
Posts: n/a
 
      09-07-2007
Hello

I just wrote a small script. I would like to know if the following is
possible:
I want to have some initial values like a time in the script. This
script is called from crontab every hour. These initial values should
be run only once when the script starts. Is there such a command in
perl ?
I thought of putting theses values in a separate file and when the
perl program starts, fetches those values and when it exist saves the
newest value so when it is called again it continues where it has
left off.

thanks
k

 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      09-07-2007
lerameur wrote:
> Hello
>
> I just wrote a small script. I would like to know if the following is
> possible:
> I want to have some initial values like a time in the script. This
> script is called from crontab every hour. These initial values should
> be run only once when the script starts. Is there such a command in
> perl ?
> I thought of putting theses values in a separate file and when the
> perl program starts, fetches those values and when it exist saves the
> newest value so when it is called again it continues where it has
> left off.


That's how you'd do it in any language. You have to store the
values somewhere because once the process exits, they're gone.
 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      09-07-2007
On Sep 7, 11:03 am, lerameur <(E-Mail Removed)> wrote:
> Hello
>
> I just wrote a small script. I would like to know if the following is
> possible:
> I want to have some initial values like a time in the script. This
> script is called from crontab every hour. These initial values should
> be run only once when the script starts. Is there such a command in
> perl ?
> I thought of putting theses values in a separate file and when the
> perl program starts, fetches those values and when it exist saves the
> newest value so when it is called again it continues where it has
> left off.


Are you looking for the time() function? perldoc -f time.

If not, please post a short-but-complete example of what it is you're
trying to do.

Paul Lalli

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running web page once a day automatically JJ ASP .Net 2 01-31-2007 05:46 AM
running aspx page once a day..how? Justin ASP .Net 2 05-25-2006 08:34 PM
So many processes running at once...are they all necessary? WF Computer Support 12 04-15-2006 09:42 AM
Regex to match say char 't' exactly once in a string and no more than once Gancy Perl Misc 4 02-03-2005 02:19 PM
Two Worker Process running at once Adam ASP .Net 5 07-29-2003 07:00 PM



Advertisments