On 7/12/07, Ronald J Kimball <[EMAIL PROTECTED]> wrote:
I need to write a utility script using Controller modules that will run
from the command line.  I haven't been able to find any examples of how
to do this.  Does anyone have a quick example I could use as inspiration?


Probably the easiest way to invoke controller code from the
commandline would be to use wget against your server.  However,
wanting to invoke controller code from the commandline is a bad design
smell usually.  Domain logic should be packaged up independently in
your Model layer (in something Catalyst-agnostic, which your Catalyst
"Model" class encapsulates thinly).

The View should handle everything specific to HTML rendering, and the
Controller should really be a very thin translation layer that maps
HTTP inputs into View updates and Model calls.  In a design laid out
like that, your question would become "How do I write a utility script
that will invoke some of my Model code", and the answer would be "use
your non-Catalyst underlying Model class directly from the script and
call whatever you need to call".

-- Brandon

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to