Tuesday, September 13, 2011

Explain the difference between 'use' and 'require' in Perl

use’ loads the module at compile time and imports symbols, semantics from that package to the current one. 'use' only works with modules.

require’ checks for redundant loading, skipping already loaded files and raises an exception on failure to find, compile, or execute file. It also translates each “::” into your system’s directory separator (/). require works with both modules and libraries.

No comments :