----- Original Message -----
From: merlyn@stonehenge.com (Randal L. Schwartz)
Date: Thursday, April 21, 2005 12:10 pm
Subject: Re: Require / Use

> >>>>> "mgoland" == mgoland  <[EMAIL PROTECTED]> writes:
> 
> mgoland> if ($certain_condition) {
> mgoland>         require Expensive::Module;
> mgoland>         my $object = Expensive::Module->new(blah);
> mgoland>         ...
> mgoland>  }
> mgoland>  and 
> 
> This require happens only when we reach that line of code at runtime.
> 
> mgoland>  if ($certain_condition) {
> mgoland>         use Expensive::Module;
> mgoland>         my $object = Expensive::Module->new(blah);
> mgoland>         ...
> mgoland>  }
> 
> This "use" happens when the code is compiled... That is, *always*.
That is a bit of counter-intuitive for me, but a good learning lesson [ now 
having the fact, realising some odd errors ]. Is there a specific reason ?? 



> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 
> 777 0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment 
> Perl training!
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to