develooper Front page | perl.perl5.porters | Postings from April 2007

Re: use parent 'Some::Class' @import_list;

Thread Previous
From:
Tels
Date:
April 30, 2007 05:09
Subject:
Re: use parent 'Some::Class' @import_list;
Message ID:
200704301344.27950@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Moin,

On Monday 30 April 2007 01:42:09 Ronald J Kimball wrote:
> On Sun, Apr 29, 2007 at 08:11:50PM -0500, Brandon Black wrote:
> > Personally, I think most people are better off without "use base".
> > For MI, it's just:
> >
> > use Foo;
> > require Bar;
> > our @ISA = qw/Foo Bar/;
> >
> > You can choose require vs use to decide whether you want import called
> > or not, and since it is assignment rather than pushes, it's not an
> > efficiency issue like the individual push statements of base.pm.
>
> Avoiding a call to import seems like the wrong reason to choose require
> over use.  You should choose require if you want to load the module at
> run-time rather than at compile-time.  If you simply don't want import to
> be called, you can do C<< use Bar (); >>.

Good point. I think I am always using "require" when I do not want to unnec. 
load modules in normal usage (like for error reporting, oututting the POD, 
loading large dependecies etc.).

All the best,

Tels



- -- 
 Signed on Mon Apr 30 13:43:31 2007 with key 0x93B84C15.
 View my photo gallery: http://bloodgate.com/photos
 PGP key on http://bloodgate.com/tels.asc or per email.

 "Duke Nukem Forever is a 1999 game and we think that timeframe matches
 very well with what we have planned for the game."

  -- George Broussard, 1998 (http://tinyurl.com/6m8nh)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iQEVAwUBRjXyu3cLPEOTuEwVAQIaTgf/RaxUuvG2JdoHrkBXe1XmBS6RuKHl1kx1
zVsPMaOe7Nzh+5qzUcAJuPTwoLD8wxVr0M7kML6UZyDTxmUPFVkfNCyXLDvu4v/n
0u8RPqUBB2TvqLu0JSsyqUH9Rtgko5zkz+aMlhwcuxgfSmDqAYXZUguROX0PL7Ql
R9Rmi7GyMo+H5y1lVkVbchMVXp1gXLsZLss5mIoQouPWzU5X9ghtLVNApeJ9qd+n
nTbMdqISi6Re2+ASscBkoRbNvVUjuvpvvyqzE6mqgW1SL3nVO8nT+CyrF3ckqorE
kvvuH4bIyhm0hKOmfITpV+3/VYJQHTmIgQDA7Z2/NFq7/qerYQKNyA==
=U9xZ
-----END PGP SIGNATURE-----

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About