[Catalyst] Access Catalyst context object from script

Anthony Gladdish anthony.gladdish at newcastle.ac.uk
Wed Oct 31 10:41:41 GMT 2012


Got a lot of code in a controller that should be moved out and into an external script (that's called by a cronjob) which calls stuff from the Model and then emails it.

The script can access the model fine and re-use a Template::Toolkit template already written fine (I'm using MIME::Lite::TT). However, in the template itself there's a lot of calls to the Catalyst context object, in the form of:

	[% Catalyst.uri_for( ... ) %]

... which aren't displaying anything. I don't really want to hard code the URIs, so is there a way to get access to the Catalyst context object of a running app, in a separate external script?


Anthony Gladdish

More information about the Catalyst mailing list