Warning: Cannot modify header information - headers already sent by (output started at /data/web/virtuals/85063/virtual/www/domains/waldauf.org/lib/plugins/color/syntax.php:1) in /data/web/virtuals/85063/virtual/www/domains/waldauf.org/inc/actions.php on line 180
programming:perl:subroutine - WiKi

Differences

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

Link to this comparison view

programming:perl:subroutine [2014/04/03 15:46]
waldauf [Shift operator]
programming:perl:subroutine [2015/03/31 22:45] (current)
Line 1: Line 1:
-====== Subroutine ====== +====== Subroutine ======  
- +  
- +  
-===== Read input parameters ===== +===== Read input parameters =====  
- +  
-You can use input array - ''@_'' or ''shift'' operator. +You can use input array - ''@_'' or ''shift'' operator.  
- +  
-==== Shift operator ==== +==== Shift operator ====  
- +  
-order of the input parameters must be strictly adhered to:<code perl> +order of the input parameters must be strictly adhered to:<code perl>  
-sub ss { +sub ss {  
-  $a = shift; +  $a = shift;  
-  $b = shift; +  $b = shift;  
-  return $a + $b; +  return $a + $b;  
-+}  
- +  
-print &ss(4,5);+print &ss(4,5);
 </code> </code>
Navigation
Print/export
Toolbox