[Dancer-users] AUTOLOADed methods in use'd Perl module not found

David Precious davidp at preshweb.co.uk
Thu Jul 5 18:42:08 CEST 2012


On Thu, 05 Jul 2012 16:19:52 +0000 (GMT)
David Gethings <dgethings at me.com> wrote:

> Hi All,
> 
> Long time Perl coder but new to Modern Perl and Dancer.

Welcome!

Are you the David Gethings I think you almost certainly are?  If so,
small world - howdy :)


> I am using Dancer to provide a RESTful API to an existing Perl
> module. The problem I have is that none of the AUTOLOADed methods
> appear to work when I use the module in Dancer. If I use the module
> in a CLI script the AUTOLOADed methods work. Any ideas why the
> AUTOLOADed methods are not found?

I'm not sure OTTOMH; however I just tried a brief test case and
confirmed that AUTOLOAD gets called in a basic Dancer app:

#!/usr/bin/perl
use strict;
use Dancer;

sub AUTOLOAD {
    print "AUTOLOAD got called\n";
}

get '/' => sub {
    bar();
    "bar() called";
};

dance();


Running the above, I see "AUTOLOAD got called" in the output.

That's probably over-simplifying things a little, but does prove that
(at least for me) Dancer doesn't clobber an AUTOLOAD.


> I've done some googling and have had no success in finding anyone
> with a similar problem. Nor can I find away to access the Perl
> debugger when using Dancer to see what my available object methods
> are.

You should be able to set a breakpoint within a route handler or
wherever you want to?



-- 
David Precious ("bigpresh") <davidp at preshweb.co.uk>
http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook
www.preshweb.co.uk/cpan        www.preshweb.co.uk/github




More information about the Dancer-users mailing list