http://qs321.pair.com?node_id=1025618


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

Replies are listed 'Best First'.
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!