Hacker News new | ask | show | jobs
by archi42 215 days 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.