Difference between revisions of "Tutorials/Perl Tutorial"

From ThorstensHome
Jump to: navigation, search
Line 1: Line 1:
 +
{{DISPLAYTITLE:Perl Tutorial}}
 
What I had to learn about perl:
 
What I had to learn about perl:
  
Line 22: Line 23:
 
</pre>
 
</pre>
 
$url then contains what was in before, but without http://
 
$url then contains what was in before, but without http://
 +
 +
= See also =
 +
* http://en.wikibooks.org/wiki/Perl_Programming

Revision as of 05:41, 11 May 2009

What I had to learn about perl:

Contents

open files

For writing

open(FILE, ">"."$filename"); 
print(FILE "hello world");

functions with parameters

In any function (sub) you can access the parameters only via

$_[0]

for the first parameter

$_[1]

for the second parameter and so on.

preg_replace

Preg_replace in perl works like this:

 $url =~ s\http://\\g;

$url then contains what was in before, but without http://

See also