3 ms·
Hm, if I understand this correctly - awkward function argument syntax: my ($x, $y) = @_; then you might be interested to learn about feature 'signatures':
by archi42 11mo ago
Hm, if I understand this correctly
- awkward function argument syntax: my ($x, $y) = @_;
then you might be interested to learn about feature 'signatures':
use feature 'signatures';
use strict;
use warnings;
sub foobar ($foo, $bar = undef) {
# do something smart
}
# call it:
foobar(1);
foobar(1, 2);
Not sure when it was added, but when I write the usual glue code, I love to use it these days.