Using -> operator to call a subroutine by its reference : Subroutine Reference « Subroutine « Perl






Using -> operator to call a subroutine by its reference

   


$codereference = sub {print shift};

$codereference->("Hello!\n");

   
    
    
  








Related examples in the same category

1.Call subroutine with parameter by using its reference
2.Call a subroutine through its reference
3.References to subroutines.