This is the next one for differences in Use Vs Require that adds to my series of posts such as Differences IPv4 Vs IPv6, Differences Routing Vs Routed protocol, SMTP Vs ESMTP, Load Testing Vs Stress Testing and IMAP Vs POP3.
| Use | Require |
| Loads module at compile time | Loads module/libraries at runtime |
| Imports symbols/semantics from module only one time | Avoids redundant loading of ‘require’d files/symbols multiple times |
| Errors can be handled inside module itself. | Terminates program if there are errors in ‘require’d file or if file is not found. |
| Use Module; equivalent to, BEGIN { require Module; import Module ; } | require ‘Module.pm’ |
| Does not require file extension to use file | Requires file extension (.pm) to ‘require’ file. |
If you are aware of any improvements to above differences or want to add to the above list then please post your comments below.
You may also be interested in,
+ Differences IPv4 Vs IPv6
+ Differences Routing Vs Routed protocol
+ HTML Vs HTML5
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=83f4bde6-8c8a-4c60-8ff8-1910311f51b7)


0 comments:
Post a Comment
Your valuable comments are welcome. (Comments will be moderated.)