Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.




Question: Question: What are the difference between "use", "import" and "require" in Perl?

Surabhi Chaudhary
2465 days ago

Question: What are the difference between "use", "import" and "require" in Perl?
Answers
0

The differences are many and often subtle:
use only expects a bareword, require can take a bareword or an expression
use is evaluated at compile-time, require at run-time
So they behave differently but achieve the same goal. Then there's a list of cultural differences in addition to the technical differences, but they're not so hard and fast.

See also the manuals for details:
perldoc -f require
perldoc -f use and
perldoc perlmod on modules.