The standard practice is to use use most of the time, sometimes require and do rarely.
do 'file' will execute file as a Perl script. It is almost like calling eval on the contents of a file; if you do the same file several times (for example, in a loop), it will be analyzed and evaluated each time, which is unlikely to be what you want. The difference between do and eval is that do cannot see lexical variables in the scope, which makes it more secure. do sometimes useful for simple tasks, such as processing a configuration file written as Perl code.
require 'file' is similar to do 'file' , except that it will parse only one particular file once and will throw an exception if something goes wrong. (for example, the file cannot be found, it contains a syntax error, etc.). Automatic error checking makes it a good substitute for do 'file' , but it is still only suitable for the same simple purposes.
The forms do 'file' and require 'file' are hyphenations from the last days when the * .pl file extension meant "Perl Library". The modern way to reuse code in Perl is to organize it into modules. Calling something “module” instead of “library” is just semantics, but words mean completely different things in Perl culture. A library is just a collection of routines; the module provides a namespace, which makes it much more suitable for reuse.
use Module is the normal way to use code from a module. Note that Module is the name of the package as an annual word, and not a quoted string containing the file name. Perl handles the translation from package name to file name for you. The use statements are executed at compile time and throw an exception if they fail. This means that if a module depending on your code is unavailable or cannot load the error, this will be obvious right away. In addition, use automatically calls the import() method of the module, if it has one that can get you a little bit.
require Module is similar to use Module , except that it happens at runtime and does not automatically call the import() module method. Usually you want to use use for failure earlier and predictably, but sometimes require better. For example, require can be used to delay loading large modules, which are only occasionally required, or to make the module optional. (i.e. use the module if it is available, but return to something else or reduce functionality if it is not.)
Strictly speaking, the only difference between require Module and require 'file' is that the first form triggers automatic translation from the name of the package, such as Foo::Bar , to the file name, for example Foo/Bar.pm , while the last the form expects the file name to start with. By convention, however, the first form is used to load modules, and the second form is used to load libraries.