[Catalyst] 'require' vs 'use' in Catalyst*
Yuval Kogman
nothingmuch at woobling.org
Thu Aug 10 20:04:02 CEST 2006
On Thu, Aug 10, 2006 at 10:54:32 -0700, Rodney Broom wrote:
use is almost like a macro. require is a function.
That said, the way plugins/components are loaded will not change
for compatibility reasons.
I suggest you create
MyApp::Model::MySchema
and 'use' it there:
package MyAPp::Model::MySchema;
use base qw/Catalyst::Model/;
use MyApp::Schema::Main;
> With require(), I'm forced to call import() explicity in that package.
Where is it being required()'d? Why not just 'use' this at the top
of your model code?
Now, at this stage there's some heavy wheel reinvention going on.
Are you aware of Catalyst::Model::DBIC::Schema?
> Under Catalyst, I get all classes. Outside of Catalyst (scripts) I tend to only use what I need:
>
> # user_maint.pl
> use MyApp::Schema::Main qw(User);
> $schema = MyApp::Schema::Main->new($db_conn_name);
Is this for efficiency reasons?
--
Yuval Kogman <nothingmuch at woobling.org>
http://nothingmuch.woobling.org 0xEBD27418
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060810/12444e04/attachment.pgp
More information about the Catalyst
mailing list