[Catalyst] 'require' vs 'use' in Catalyst*
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
and 'use' it there:
use base qw/Catalyst::Model/;
> 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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 191 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060810/12444e04/attachment.pgp
More information about the Catalyst