Perl

From Colettapedia
Jump to navigation Jump to search

Using Modules

  • perldoc perllocal = shows what modules are installed on a given system
  • get cpan if necessary and install (may also need Test::Simple and Digest::SHA to aid in downloading and checking of modules.
  • sudo cpan -i Foo::Bar (get name of Foo::Bar from cpan.org)
  • perldoc Foo::Bar = see user contributed perl documentation (man pages) of the module you just downloaded

Executables

  • cpan
  • perldoc = Look up Perl documentation in Pod format.
    • -f perlfunc = look up specific builtin functions, ex: perldoc -f sprintf

Running Perl "perlrun"

  • perl -V = Summary of perl5 configuration.
  • perl -d and -D = debug options

Syntax

  • indicate end of program using the "__END__" token
  • specify certain version of perl by statement "use 5.005_54;" or similar