Syntactic Confectionery Delight | |
PerlMonks |
Re: Re: Re: using 'use' conditionallyby blssu (Pilgrim) |
on Nov 07, 2002 at 16:56 UTC ( [id://211122]=note: print w/replies, xml ) | Need Help?? |
Sure, that's pretty close to what 'use' does now, but the 'eval' helps future-proof your code. The hand-rolled import isn't clever, it's just extra work. Laziness is one of the three pillars... The common efficiency and security disadvantages of 'eval' aren't issues here because (1) run-time 'require' must do an 'eval' eventually anyway, and (2) the 'eval' uses a string constant that is easy to understand and verify.
In Section
Seekers of Perl Wisdom
|
|