[Catalyst] myapp_test.pl - running code from the command line

David Schmidt davewood at gmx.at
Wed Nov 3 07:10:01 GMT 2010


On Wed, Nov 3, 2010 at 7:40 AM, Jonathon Soong
<jon at investmentscience.com.au> wrote:
> Hi
>
>> What kind of code do you actually want to run?
>> Perhaps it would be smarter to put that code into the model and then
>> run a perl script from cron that makes use of that model thus
>> bypassing the HTML authentication (which might be ok considering the
>> code is run from the system)
>
> Yes I realise now it might make more sense in the Model, but at the moment it is in the Controller (it is someone else's code, so more difficult for me to refactor).
>
> There are two questions I have then:
> 1. How do you call a Model's function from the command line?
> 2. Is there no way to call controller methods that require authentication?
>
> Thanks
>
>
> Jon
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>

1) put code in an app independent module, your model uses that module
and so can you.
2) http://search.cpan.org/~petdance/WWW-Mechanize-1.66/lib/WWW/Mechanize.pm

... oh and what Octavian said.



More information about the Catalyst mailing list