Declaration with prototype : prototype « Subroutine « Perl






Declaration with prototype

   

sub mynumbs(@$;$);       # Declaration with prototype
@list=(1,2,3);
mynumbs(@list, 25);
sub mynumbs(@$;$) {      # Match the prototypes
     my ($scalar)=pop(@_);
     my(@arr) = @_;
     print "The array is: @arr","\n";
     print "The scalar is $scalar\n";
}

   
    
    
  








Related examples in the same category

1.Check the prototype
2.Prototypes