Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Problems in dates and time additions by one minute

by graff (Chancellor)
on Dec 20, 2011 at 04:05 UTC ( #944329=note: print w/replies, xml ) Need Help??


in reply to Re^2: Problems in dates and time additions by one minute
in thread Problems in dates and time additions by one minute

What in particular is not clear to you in these snippets?

In the first part, $6 contains whatever was matched by the 6th set of parens in the previous regex match (basically, everything in the log entry following the time stamp string), $ts is the "seconds since the epoch" time-stamp that corresponds to the matched time stamp string in the log entry, and the if statement returns true on any case-insensitive match of a "word" token from the log entry to the target $word.

The second part is a loop over hash keys that are being sorted numerically. The first line in the loop creates an array ref containing the list of values returned by localtime, and then uses selected values from that array to create a string that is formatted the same way as the original log entry time stamp string.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://944329]
help
Chatterbox?
[james28909]: it would be to much work just to get around renaming three subs lol
[james28909]: but you could put it all in one sub and return the same data type that was inputted. i could write a small example maybe
[Lady_Aleena]: Their uses are also vastly different.
[Lady_Aleena]: The first two make hashes and arrays from a file, the third returns data from a pre-existing hash.
[Lady_Aleena]: Well, HoH and AoH respectively.
[Lady_Aleena]: But if you want to play, play. I don't mind. 8)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-05-24 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?