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 | |
by trippledubs (Deacon) on Mar 10, 2015 at 04:34 UTC | |
by Anonymous Monk on Mar 10, 2015 at 07:57 UTC | |
by Anonymous Monk on Mar 10, 2015 at 13:08 UTC | |
|
Re^2: value disappears in if statement
by ggadd (Acolyte) on Mar 10, 2015 at 22:49 UTC |