Perl

From SkyWiki

(Difference between revisions)
Jump to: navigation, search
m (PERL moved to Perl)
Line 1: Line 1:
 +
locally install Perl:
 +
 +
<pre>
 +
./Configure -d -D prefix=$HOME
 +
make
 +
make install
 +
</pre>
 +
 +
-> in Perl-Scripts eintragen:
 +
#!home/mike/bin/perl -w
 +
 +
in .profile, .bashrc o.ä.:
 +
export PATH=$HOME/bin:$PATH
 +
 +
CPAN-Aufruf:
 +
perl -NCPAN -eshell
 +
 +
CPAN-Initialisiserung:
 +
<pre>
 +
install Bundle::libnet
 +
install Bundle::CPAN
 +
install MD5
 +
install Bundle::LWP
 +
install HTML::Parser
 +
install HTML::Tree
 +
install Archive::Tar
 +
install GD
 +
install Chart
 +
</pre>
 +
 +
== [http://www.perl.org/ Perl] syntax ==
== [http://www.perl.org/ Perl] syntax ==
[[category:remember]]
[[category:remember]]

Revision as of 10:41, 20 September 2008

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 -NCPAN -eshell

CPAN-Initialisiserung:

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


Perl syntax

read a file line by line

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