Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: infinite loop blues

by tilly (Archbishop)
on Jun 26, 2003 at 21:07 UTC ( [id://269414]=note: print w/replies, xml ) Need Help??


in reply to infinite loop blues

What happens if the eval that you use for the import fails for any reason? Check $@ and see if it actually imports correctly.

If that doesn't fix it, then before your goto I would test a can to be sure that it should be found, and start debugging what package it went into, etc.

But I will bet that it is an error hidden behind eval's error trapping.

UPDATE: The reason why this is an infinite loop is that you call a method which is not there, falls into an AUTOLOAD, which calls the same method, it still is not there, falls into the same AUTOLOAD, etc.

Replies are listed 'Best First'.
Re: Re: infinite loop blues
by jynx (Priest) on Jun 26, 2003 at 21:30 UTC
    doh, got it in one.

    it was not in fact importing correctly, because of a bad method setup. In the print_forms.pm file it had up near the top something that i didn't notice until i added the following line to server.pm:

    if (eval { require $method }) { $method =~ s/^functions\/(.*)\.pm$/$1/; eval "import functions::${method}"; die $@ if $@; # added this, which gave me the error message i +needed...
    After running it i got the error message "function commit redefined", which told me the error right away! i promptly opened the print_forms.pm file and told it to EXPORT print_forms instead of commit (oops, i'm usually much better at changing things after a copy/paste :-(

    So that fixed the problem, but why was it infinite looping? Why didn't it stop after one iteration?

    jynx

    PS i can't believe i, yet again, made the "select is broken" error. i thought i had progressed past that stage. grrr...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2024-04-24 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found