Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: