Perl

From SkyWiki

(Difference between revisions)
Jump to: navigation, search
m
Line 14: Line 14:
CPAN-Aufruf:
CPAN-Aufruf:
-
  perl -NCPAN -eshell
+
  perl -MCPAN -eshell
CPAN-Initialisierung:
CPAN-Initialisierung:

Revision as of 09:17, 14 March 2009

locally install Perl:

./Configure -d -D prefix=$HOME
make
make install

-> in Perl-Scripts eintragen:

#!home/mike/bin/perl -w

in .profile, .bashrc o.ä.:

export PATH=$HOME/bin:$PATH

CPAN-Aufruf:

perl -MCPAN -eshell

CPAN-Initialisierung:

install Bundle::libnet
install Bundle::CPAN
install MD5
install Bundle::LWP
install HTML::Parser
install HTML::Tree
install Archive::Tar
install GD


Perl syntax

read a file line by line

  open(IN, '<'.$ARGV[0]);
  foreach(<IN>) {
    chomp;
    print $_, "\n";
  }
  close(IN);
Personal tools