[cgiapp] Re: packages autouse?

Porta julian.porta at gmail.com
Thu Jun 11 19:15:39 EDT 2009


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, Jun 11, 2009 at 8:14 PM, Ron Savage <ron at savage.net.au> wrote:

> 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!
> --
> Ron Savage
> ron at savage.net.au
> http://savage.net.au/index.html
>
>
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>


More information about the cgiapp mailing list