From bg271828 at yahoo.com Thu Aug 17 17:30:38 2017 From: bg271828 at yahoo.com (Dr. Jennifer Nussbaum) Date: Thu, 17 Aug 2017 17:30:38 +0000 (UTC) Subject: [Catalyst] Using MooseX role in Cat model (semi-OT) References: <1776120740.4501230.1502991038414.ref@mail.yahoo.com> Message-ID: <1776120740.4501230.1502991038414@mail.yahoo.com> Hi. This is probably OT because it's really a Moose question, and only incidentally in a Catalyst context, but I'd be grateful for any pointers. This is sort of a followup to a question that's discussed, well and thoroughly, on Stack Overflow, but without providing the answer I need: https://stackoverflow.com/questions/40243560/moose-accessors-in-catalyst-cant-use-string-as-hash-ref-error I'm in a pretty similar situation: I have a Catalyst model, which doesn't in fact need to be an actual Catalyst model (that is, I could move it outside the Model namespace to "Utility" or something, and it would be OK). I want to use MooseX::LogDispatch from within this. Basically: ---package MyApp::Model::Email;use Moose;?use namespace::autoclean;with 'MooseX::LogDispatch'; extends Catalyst::Model; # maybe this isn't needed, and I could move the package has log_dispatch_conf => ( # config setup here--NOT using any Cat config); sub generate_bcc_line {? my ($self, @args) = @_;? $self->logger->info("Generating bcc line");? # ...--- As in the Stack Overflow question, if I try calling send_email() from a test script with "MyApp::Model::Email->generate_bcc_line", I get the "Can't use string ("MyApp::Model::Email") as a HASH ref" error. If, in the test script, I get $c with the $ctx_request thing, and call $c->model('Email')->generate_bcc_line, then it works. I'm pretty new to Moose, and don't understand how I could be integrating this into my package. My question is: What if I WANT to call this from outside Catalyst? That is, suppose I move MyApp::Model::Email to MyApp::Utility::Email, so I can call it from a cronjob or something. How do I get LogDispatch to work? I'd still want to log things even in a non-web context. But if my outside script has "use MyApp::Utility::Email->generate_bcc_line", LogDispatch will error too. But since LogDispatch isn't connected to Catalyst, there must be a way to use it the way I'm suggesting. What is that way? Thank you. Jen -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco at vittorini.org Mon Aug 28 13:44:38 2017 From: marco at vittorini.org (Marco Vittorini Orgeas) Date: Mon, 28 Aug 2017 15:44:38 +0200 Subject: [Catalyst] Hosting Catalyst on OpenShift online v3 Message-ID: <2e01076d-5c81-4d0d-ba18-647332015f68@vittorini.org> Hi! I'm investigating openshift v3 cloud hosting platform - https://www.openshift.com/about/index.html - to host some perl projects, and in particular I'd like to know if somebody has already tried or is already hosting Catalyst based apps on openshift. The "official" Perl resources - https://docs.openshift.com/online/using_images/s2i_images/perl.html#perl-templates - are focused on a sample application built on Dancer2, and my researches haven't provided anything relevant to Catalyst. On "the paper" it should work, but I'd like to hear any comments or past experience if any. Naturally, I'm also interested in any related analysis on the pros/cons of having Perl code running on openshift, particularly if you have already done some evaluation in this sense: I had past experience with openshift v2 and some simple CGI::Application in this regard, and I should say that the experience has been not bad at all. Thank you. -- Marco Vittorini Orgeas