[Mathematica notebook of this page]
There are a few different ways to load a package in Mathematica. The quick and dirty way (if your browser displays the contents of the .m file as text) is to copy the whole contents of the package, paste it into the Mathematica front end, and Shift+Enter to evaluate it. The drawback of this method is that it makes a big mess in the notebook.
A slick and cleaner way of loading a package is to import it directly from the web. For example, the following loads the package ListTricks.
Import["http://thales.math.uqam.ca/~rowland/packages/ListTricks.m"]
If you intend to use a package more than once, it's probably better to download it to your hard drive or user directory. Once this is done, you can load it by specifying the path and file name; for example (in Windows)
<<"C:\\ListTricks.m"
or
<<"C:\\Documents and Settings\\All Users\\Application Data\\Mathematica\\Applications\\ListTricks.m"
Alternatively, if you downloaded the package to one of the directories listed in
$Path
then you can load it more succinctly by evaluating the following. This is also how to load the standard packages, such as Combinatorica.
<<ListTricks`
(Note that the last character is a back tick (reverse single quotation mark), which is located to the left of the '1' key on US keyboards.)
To see all the symbols available in the package, evaluate the following.
?ListTricks`*