variable running once

Discussion in 'Perl Misc' started by lerameur, Sep 7, 2007.

  1. lerameur

    lerameur Guest

    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
    lerameur, Sep 7, 2007
    #1
    1. Advertising

  2. lerameur

    J. Gleixner Guest

    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.
    J. Gleixner, Sep 7, 2007
    #2
    1. Advertising

  3. lerameur

    Paul Lalli Guest

    On Sep 7, 11:03 am, 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.


    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
    Paul Lalli, Sep 7, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam
    Replies:
    5
    Views:
    422
    Jim Cheshire
    Jul 29, 2003
  2. Justin

    running aspx page once a day..how?

    Justin, May 25, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    478
    Mark Rae
    May 25, 2006
  3. JJ
    Replies:
    2
    Views:
    286
    Shahzad Godil
    Jan 31, 2007
  4. jotto
    Replies:
    2
    Views:
    103
    Robert Klemme
    Oct 14, 2006
  5. Gancy
    Replies:
    4
    Views:
    163
    Rasto Levrinc
    Feb 3, 2005
Loading...

Share This Page