in reply to hashref return fails

Given only your code and your description that the print statement works, that does seem quite strange. Have you stepped through the code in the debugger? Can you reduce your code down to an example that reproduces the problem that you can post here for others to run?

(By the way, DateTime::Format::Strptime can handle what your sub foo is doing.)

Replies are listed 'Best First'.
Re^2: hashref return fails
by FloydATC (Deacon) on May 28, 2015 at 13:27 UTC
    return unless $dt;

    Exactly what are you returning here unless $dt is true?

    -- FloydATC

    Time flies when you don't know what you're doing

      But look at where the print statement is which the OP claims works...