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

Re: Display tide based on time now.

by GrandFather (Cardinal)
on Mar 27, 2013 at 02:40 UTC ( #1025618=note: print w/ replies, xml ) Need Help??


in reply to Display tide based on time now.

Works for me, or at least generates the following output which I guess is right:

2013/03/27, 03:35 PM - Now in Seconds is: 1364351700 Test: High Tide at: 12:21 AM Test: Low Tide at: 06:20 AM Test: High Tide at: 12:50 PM Test: Low Tide at: 06:39 PM Option 3

Note that I changed the file read line to:

local $/; my $data = $xml->XMLin(<DATA>);

and put the data in a __DATA__ block to save generating a file in addition to the script.

True laziness is hard work


Comment on Re: Display tide based on time now.
Select or Download Code
Re^2: Display tide based on time now.
by Anonymous Monk on Mar 27, 2013 at 02:47 UTC
    It works inside of the "foreach", but I would like to print the results outside of the "foreach" based on the time now, thats why I have the "IFs" below on the code.
Re^2: Display tide based on time now.
by Anonymous Monk on Mar 27, 2013 at 03:00 UTC
    The result I am expecting should only be one of "Test:" lines printed inside of the foreach based on the time range of now and the time form the XML. That is my issue!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-09-18 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls