DEV Community

Discussion on: Perl modules loading, calling or returning

Collapse
 
matthewpersico profile image
Matthew O. Persico
$ perl -I. -e 'Bazinga::joke(); use Bazinga;'
Bazinga
It would not be the same with imports at runtime.
$ perl -I. -e 'Bazinga::joke(); require Bazinga;'
Undefined subroutine &Bazinga::joke called at -e line 1.

That is the best demonstration I have every seen for the difference between use and require.

Collapse
 
thibaultduponchelle profile image
Tib

Thank you a lot 😃