Factor out the functionality you need into another module, then call it both from the Dancer front-end and from a script crafted for the command line.
Another approach would be looking at the Dancer's testing modules/functions, they are geared at simulating calls without having a running instance. I'd go for the first approach, anyway.
Cheers,
Flavio.
Hello,
I have a big project running on Dancer. This project has some service scripts (to do some cron jobs for example), written as functions in this Dancer app, that should have access to all usual environment (as called from the web functions have), but I need to be able run them from command line.
What is the best way to do it?
Example:
get '/service_func' => {...};
I want to do something like
# ./bin/app.pl --run=service_func
--
Best Regards,
Nick Knutov
http://knutov.com
ICQ: 272873706
Voice: +7-904-84-23-130
_______________________________________________
Dancer-users mailing list
Dancer-users@perldancer.org
http://www.backup-manager.org/cgi-bin/listinfo/dancer-users