Do you know where your variables are? | |
PerlMonks |
Re: Use and Require - making an informed choice. (require++)by tye (Sage) |
on Jan 30, 2006 at 17:14 UTC ( [id://526490]=note: print w/replies, xml ) | Need Help?? |
I hardly ever use a module if I'm not wanting to import() from it. Using require at the top of a script or module is not the same as using require from inside some rarely used function. If I use require at the top of a script or module, then the lack of the module will still cause my script to fail "immediately" and before the script "runs", so I see no advantage to avoiding require in favor or always useing. I prefer to require modules when it suffices because it makes it clear that the module is not importing anything and is not making compile-time changes that impact the compilation of the rest of the code. I also rarely use a module without giving a specific list of arguments to pass to its import() function. Implicit imports are the enemy of clarity. - tye
In Section
Meditations
|
|