This is an old revision of the document!
| Code | What it does | ||
|---|---|---|---|
| #!/usr/bin/perl | shebang | ||
| chomp ($text = <STDIN>); | |||
| print (“Hallo Welt!”); | |||
| $variable = “inhalt”; | |||
| print $variable; | |||
| \n | |||
| @array; | |||
| print $array[0]; | |||
| push ($array, “neuerWert”); | |||
| unshift … | |||
| pop … | |||
| shift … | |||
foreach $arrayelement (@array) {
print $arrayelement;
}
| Array mit allen Elementen ausgeben | ||
if ($zahl2 < 1000) {
print "Zahl 2 ist kleiner als 1000";
}
else {
print "Zahl 2 ist größer als 1000";
}
| Beispiel if-else | | <code>while ($count != $ergebnis) {
print $count;
print "\n";
$count++;
}</code> | While - until |
Discussion