Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Find the text

by mzedeler (Pilgrim)
on Jul 30, 2009 at 10:16 UTC ( [id://784559]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Find the text
in thread Find the text

It looks like you are trying to iterate over all whole minutes in a 30 minutes interval. That solution is very ineffective.

If you have two dates, one from your file and one from the system time, just ensure that they are unix time (seconds since 1/1/1970 00:00) and then subtract one from the other and then see if the result is between 0 and 1800. This is the criteria that decides if a given FIND line is taking place within the next half hour.

System time is already in unix time, so all you need is converting the time stamps from the file to seconds since epoch. There are plenty of modules that can do it for you.

Also, please do this:

  • use warnings;
  • use strict;
  • Indent your code.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-19 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found