[cgiapp] packages autouse?

2009-06-11 Thread Porta
Hey, folks. Question: I was wondering if anyone else (than me) thinks is annoying to declare the use of all the required models (objects? packages?) you're using in your CA app?More, when working with CAD, on each controller you need to repeat use MyApp::Foo; use MyApp::Bar; etc. Assuming you're

Re: [cgiapp] packages autouse?

2009-06-11 Thread P Kishor
On Thu, Jun 11, 2009 at 11:11 AM, Portajulian.po...@gmail.com wrote: Hey, folks. Question: I was wondering if anyone else (than me) thinks is annoying to declare the use of all the required models (objects? packages?) you're using in your CA app?More, when working with CAD, on each controller

Re: [cgiapp] packages autouse?

2009-06-11 Thread Rhesa Rozendaal
P Kishor wrote: What I do find annoying is the number steps involved in adding a new run mode, esp. when using CAD. First, add the new run mode to the dispatch table. Second, add the run mode to the setup in the module (assuming one is not using AutoRunmode... some problems have been alluded

Re: [cgiapp] packages autouse?

2009-06-11 Thread Rhesa Rozendaal
Porta wrote: Hey, folks. Question: I was wondering if anyone else (than me) thinks is annoying to declare the use of all the required models (objects? packages?) you're using in your CA app?More, when working with CAD, on each controller you need to repeat use MyApp::Foo; use MyApp::Bar; etc.

Re: [cgiapp] packages autouse?

2009-06-11 Thread Rhesa Rozendaal
Porta wrote: Hey, folks. Question: I was wondering if anyone else (than me) thinks is annoying to declare the use of all the required models (objects? packages?) you're using in your CA app?More, when working with CAD, on each controller you need to repeat use MyApp::Foo; use MyApp::Bar; etc.

[cgiapp] Re: packages autouse?

2009-06-11 Thread Porta
My initial message was more related not to cgi app related modules, but application related ones On 6/11/09, Rhesa Rozendaal p...@rhesa.com wrote: Porta wrote: Hey, folks. Question: I was wondering if anyone else (than me) thinks is annoying to declare the use of all the required models

Re: [cgiapp] Re: packages autouse?

2009-06-11 Thread Rhesa Rozendaal
Porta wrote: My initial message was more related not to cgi app related modules, but application related ones I have no idea what you're saying here. Did you look at the implementation of Modern::Perl (or ex::caution)? rhesa # CGI::Application community mailing list

Re: [cgiapp] Re: packages autouse?

2009-06-11 Thread Porta
Let me clarify. Using CAD, I have a directory that contains (what I'll call) Controllers. These Controllers are CA based packages, and each one of those manages different parts of my web application. For example, the package Controller::Accounts contains all the different runmodes related to

Re: [cgiapp] packages autouse?

2009-06-11 Thread P Kishor
On Thu, Jun 11, 2009 at 12:26 PM, Rhesa Rozendaalp...@rhesa.com wrote: P Kishor wrote: What I do find annoying is the number steps involved in adding a new run mode, esp. when using CAD. First, add the new run mode to the dispatch table. Second, add the run mode to the setup in the module

Re: [cgiapp] Re: packages autouse?

2009-06-11 Thread Ron Savage
Hi Porta On Thu, 2009-06-11 at 19:19 -0300, Porta wrote: Let me clarify. [snip] One thing that bothers me, is that on every Controller, I need to repeat the same 15 lines of So now it's time to write a program which updates the appropriate files, rather than doing it manually. Use Perl! --

Re: [cgiapp] packages autouse?

2009-06-11 Thread Richard Jones
P Kishor wrote: [..] Hi Rhesa, CAP::RunmodeDeclare looks very interesting. I actually used CAP::AutoRunmode successfully, but I remember seeing a thread on this mailing list itself about CAP::AutoRunmode causing problems under certain circumstances, particularly under mod_perl. Perhaps you

Re: [cgiapp] Re: packages autouse?

2009-06-11 Thread Porta
I have something even nastier package Nasta::Models; my $dir = 'Models'; opendir(DIR, $dir); my @files = grep(/\.pm$/,readdir(DIR)); closedir(DIR); foreach my $file (@files) { $file =~ s/\.pm//; eval use $file; } 1; But it's something that doesn't make me proud... Any suggestion? On Thu,

Re: [cgiapp] Re: packages autouse?

2009-06-11 Thread Richard Jones
Porta wrote: In order to make my Models available on each Controller. Of course, I could create a CGI::App package, add all the use lines there and base all my Controllers on that package. Sure, less lines to type on each Controller. But, every time I create a new Model, I need to make sure I

Re: [cgiapp] Re: packages autouse?

2009-06-11 Thread Porta
This is definitely a step forward, and in a similar direction of what I'm doing now (my solution is nasty and dirty but been working for me).My hesitation with this method is more philosophycal, since a Model creation depends on a Controller method (which I try to avoid, because of personal

Re: [cgiapp] Re: [OT] HTML::Parser::Simple, now with attribute parsing

2009-06-11 Thread Ron Savage
Hi Mark On Tue, 2009-04-14 at 20:14 -0400, Mark Stosberg wrote: git://github.com/ronsavage/html--parser--simple.git I've incorporated your patches to my git repo into a new distro (in my home git repo) and sent it to CPAN. I'll shortly upload the same to the shared repo. I'm amazed how long

Re: [cgiapp] packages autouse?

2009-06-11 Thread Cees Hek
Are you perhaps looking for Class::Autouse? Not something I would use myself, but it may help you be more lazy in your programming... Cheers, Cees On Fri, Jun 12, 2009 at 2:11 AM, Porta julian.po...@gmail.com wrote: Hey, folks. Question: I was wondering if anyone else (than me) thinks is