in reply to value disappears in if statement

You really should be using strict, and using a module like Time::Piece or DateTime to do your date/time handling.

Anyway, when you print your values, do you see how you've got a space before the month name? That's why the eq isn't matching it. The reason is the \s inside the first capture group; try writing $time =~ /\s([A-Z][a-z]+)/; instead.

When I print stuff during debugging, I use Data::Dumper, Data::Dump, or at least do something like print "($value)\n"; to catch whitespace issues like these. See also Basic debugging checklist.

Replies are listed 'Best First'.
Re^2: value disappears in if statement
by Anonymous Monk on Mar 10, 2015 at 03:39 UTC

    You really should be using strict

    Why?

        hi trippledubs, so your answer is because Your Mother mother said so? This is the sequence

        OP: I have question ... short code
        A: you should use strict

        Why should the OP use strict?

        There are no errors in OPs posted code that strict would catch, talking about strict is a distraction ... adding use strict; causes the OPs program to die with errors and will not help him solve any problem in the posted code

        Adding "use strict;" without any elaboration is the easiest type of comment/reply to make to any perl programming question, and it usually just makes the OPs program die ... and the OPs usually not ready to understand how to benefit from strict

        Is strict useful? Yes, I used it here cause I always use it

        Useful to the OP? I doubt it

Re^2: value disappears in if statement
by ggadd (Acolyte) on Mar 10, 2015 at 22:49 UTC

    I figured it would probably be something simple...thanks a mil. I considered everything except the whitrspace!