Call subroutine with parameter by using its reference : Subroutine Reference « Subroutine « Perl






Call subroutine with parameter by using its reference

   

$codereference = sub {print shift};

&$codereference("Hello!\n");

   
    
    
  








Related examples in the same category

1.Using -> operator to call a subroutine by its reference
2.Call a subroutine through its reference
3.References to subroutines.