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:29] lunetikkperl:basic [2018/12/20 17:45] (current) – Discussion status changed lunetikk
Line 14: Line 14:
 |  pop …  |  Remove at the end  |   |  pop …  |  Remove at the end  |  
 |  shift …  |  Remove at the beginning  |   |  shift …  |  Remove at the beginning  |  
-|  <code>foreach $arrayelement (@array) {+|  <code perl>foreach $arrayelement (@array) {
     print $arrayelement;     print $arrayelement;
 }</code>  |  Output of all arrayelements   |   }</code>  |  Output of all arrayelements   |  
-|  <code>if ($nr2 < 1000) {+|  <code perl>if ($nr2 < 1000) {
     print "nr 2 is smaller than 1000";     print "nr 2 is smaller than 1000";
 } }
Line 23: Line 23:
     print "nr 2 is bigger than 1000";     print "nr 2 is bigger than 1000";
 }</code>  |  Example if-else  | }</code>  |  Example if-else  |
-|  <code>while ($count != $result) {+|  <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.1433928594.txt.gz · Last modified: 2017/03/01 12:50 (external edit)