Check the prototype : prototype « Subroutine « Perl





Check the prototype

   

#!/usr/bin/perl

use strict;
use warnings;

sub add_two ($$) {
    return $_[0]+$_[1];
}

print prototype(\&add_two),"\n"; # produces '$$'
print prototype('add_two'),"\n"; # likewise

   
    
    
  










Related examples in the same category

1.Declaration with prototype
2.Prototypes