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 <[email protected]> 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
> [email protected]
> http://savage.net.au/index.html
>
>
>
> ##### CGI::Application community mailing list ################
> ## ##
> ## To unsubscribe, or change your message delivery options, ##
> ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ##
> ## ##
> ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ##
> ## Wiki: http://cgiapp.erlbaum.net/ ##
> ## ##
> ################################################################
>
>
##### CGI::Application community mailing list ################
## ##
## To unsubscribe, or change your message delivery options, ##
## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ##
## ##
## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ##
## Wiki: http://cgiapp.erlbaum.net/ ##
## ##
################################################################