Thursday, 22 August 2013

Is there a signature for methods in Perl?

Is there a signature for methods in Perl?

I want to clear my understanding on the following.
Assume I have a Perl module with a function that expects 3 parameters.
E.g. in the function:
my ($a, $b, $c) = @_;
Now this function is being called by 2 different other scripts.
One of the scripts needs some "additional" functionality so. If I pass
some e.g. 2 extra parameters to the function e.g.
my ($a, $b, $c, $d, $e) = @_; and use them if they are defined, this would
not cause any problems right?
My main concern is, there is no function signature or similar in perl
right? So I can pass any arguments

No comments:

Post a Comment