variable running once

L

lerameur

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
 
J

J. Gleixner

lerameur said:
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.
 
P

Paul Lalli

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top