References to subroutines. : Subroutine Reference « Subroutine « Perl






References to subroutines.

   
#!/usr/bin/perl 
sub print_coor{ 
    my ($x,$y,$z) = @_; 
    print "$x $y $z \n"; 
    return $x;
}; 
$k = 1; 
$j = 2; 
$m = 4; 
$this = print_coor($k,$j,$m); 
$that = print_coor(4,5,6); 

   
    
    
  








Related examples in the same category

1.Using -> operator to call a subroutine by its reference
2.Call subroutine with parameter by using its reference
3.Call a subroutine through its reference