Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Exception error in perl code

by ikegami (Patriarch)
on Jun 25, 2009 at 11:23 UTC ( [id://774670]=note: print w/replies, xml ) Need Help??


in reply to Exception Error in perl code

[ Reparented from later thread ]

timelocal doesn't like your inputs. It's even nice enough to tell you what they are.

Apparently, @dmy contains two elements, both zero, when used to populate the args of timelocal.

That's surely due to my $t = @match_list; setting $t to the number of elements in @match_list.

This is very straightforward debugging. Your variable doesn't contain what it should, so you backtrack until you find where the program's state differs from your expectations.

As an aside, I wonder why you chose to ignore the warning lc $dmy[1] must have issued.

Update: The above debugging would have taken less time than posting the question in at least three different places. Over the span of 9 days, no less! And you already got an answer 8 days ago! *boggled*

Replies are listed 'Best First'.
Re^2: Exception error in perl code
by jwkrahn (Abbot) on Jun 25, 2009 at 11:37 UTC

    Why would  lc $dmy[1] issue a warning?

      oops, I thought lc(undef) would give a warning, but testing shows otherwise.
Re^2: Exception error in perl code
by Rajsri (Initiate) on Jun 29, 2009 at 05:23 UTC
    Hi ikegami, Thanks for the reply. I am new to perl programming, could you please let me know how to overcome this error. How should i assign @dmy. -Rajini

      You should start by reading my post again, which explains @dmy contains junk because $t contains junk. Fix the latter.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 10:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found