Package management in Perl

Use the cpan command-line tool. This can also be invoked via the command

perl -MCPAN -e shell

In the shell, type

install <packagename>

where <packagename> is something like Time::HiRes or Tk.

If it hangs for ages whilst trying to download files over FTP, or get errors like

LWP failed with code[400] message[FTP return code 150]

then try setting the FTP_PASSIVE environment variable before running cpan:

export FTP_PASSIVE=1

(See  this page for more details of this problem.)