Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

TIME: Adding Up and Predicting it

by brusimm (Pilgrim)
on Aug 24, 2007 at 14:13 UTC ( #634867=perlquestion: print w/replies, xml ) Need Help??

brusimm has asked for the wisdom of the Perl Monks concerning the following question:

Once again, I turn to the wisdom of the ages for Perl.

I've written a procedure that reads (grep) a file, finds certain parameters, spits them back out to the screen, and loops in a defined amount of minutes that the user is asked for. (The file is updated constantly by another 3rd procedure)

At the bottom of the print out, (After reading `date`) I print out what time this print out is, and I would like to print out the next time the print out will occur.

IE: Here's your search term, review it every x minutes, here's the time I reviewed your file.

MY QUESTION: So besides splitting the `date` into arrays and scalars, adding the time loop to the minutes, then reconstructing the time to print it back out, is there a function (Or more economical way) in Perl that can do this?

My way will work, but I've got a lot of lines for a single line of printout that is just a courtesy to the user.

note: I haven't replicated the script here because it is in my work space, and the customer does not allow material outside of their steel box!! I'd have to retype it completely.

Any thoughts or suggestions would be appreciated.
Thanks everyone,

Replies are listed 'Best First'.
Re: TIME: Adding Up and Predicting it
by Joost (Canon) on Aug 24, 2007 at 14:30 UTC
      If you need more than those functions provide, check out the many modules under the Date::* and Time::* namespaces on CPAN.
Re: TIME: Adding Up and Predicting it
by codeacrobat (Chaplain) on Aug 24, 2007 at 16:42 UTC
    You also may want to have a look at File::Modified if your true objective is to react on whenever a file had changed.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://634867]
Approved by Joost
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-12-04 01:25 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (30 votes). Check out past polls.