Site Tools


perl:basic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
perl:basic [2015/06/10 11:15] lunetikkperl:basic [2018/12/20 17:45] (current) – Discussion status changed lunetikk
Line 1: Line 1:
-====== AutoIt Basic ======+====== Perl Basic ======
  
 ^  Code  ^  What it does  ^ ^  Code  ^  What it does  ^
 |  #!/usr/bin/perl  |  shebang  | |  #!/usr/bin/perl  |  shebang  |
-|  chomp ($text = <STDIN>);  |  Texteingeben ohne "enter |   +|  chomp ($text = <STDIN>);  |  Insert text without a "nextline |   
-|  print ("Hallo Welt!");  |  Textausgeben    +|  print ("Hallo Welt!");  |  Text output    
-|  $variable = "inhalt";  |  Variable anlegen    +|  $variable = "inhalt";  |  Add a variable    
-|  print $variable;  |  Variable ausgeben    +|  print $variable;  |  Variable output    
-|  \n  |  Nextline (Zeilenumbruch)    +|  \n  |  Nextline  |   
-|  @array;  |  Array anlegen    +|  @array;  |  Add array    
-|  print $array[0];  |  Array Position ausgeben    +|  print $array[0];  |  Output of array position 0  |   
-|  push ($array, "neuerWert");  |  Am Ende des Arrays anfügen    +|  push ($array, "newValue");  |  Add to the end of the array    
-|  unshift …  |  Am Anfang des Arrays hinzufügen    +|  unshift …  |  Add to the beginning    
-|  pop …  |  Am Ende des Arrays entfernen    +|  pop …  |  Remove at the end    
-|  shift …  |  Am Anfang des Arrays entfernen    +|  shift …  |  Remove at the beginning    
-|  <code>foreach $arrayelement (@array) {+|  <code perl>foreach $arrayelement (@array) {
     print $arrayelement;     print $arrayelement;
-}</code>  |  Array mit allen Elementen ausgeben  |   +}</code>  |  Output of all arrayelements   |   
-|  <code>if ($zahl2 < 1000) { +|  <code perl>if ($nr2 < 1000) { 
-    print "Zahl ist kleiner als 1000";+    print "nr is smaller than 1000";
 } }
 else  { else  {
-    print "Zahl ist größer als 1000"; +    print "nr is bigger than 1000"; 
-}</code>  |  Beispiel if-else +}</code>  |  Example if-else 
-|  <code>while ($count != $ergebnis) {+|  <code perl>while ($count != $result) {
     print $count;     print $count;
     print "\n";     print "\n";
     $count++;     $count++;
 }</code>  |  While - until  |   }</code>  |  While - until  |  
 +
 +\\
 +\\
 +~~DISCUSSION:closed~~
  
perl/basic.1433927713.txt.gz · Last modified: 2017/03/01 12:50 (external edit)