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

  Yes, I hate to write

  sub foo($$$) {
    my ($a, $b, $c) = @_;
  }
Where @_ is array of arguments, and ($$$) is function prototype (3 scalars are expected).


Perl has subroutine signatures now. You can write

sub foo ($x, $y, $x) { ...}

It's just syntactic sugar, so you still can't pass in multiple lists, and the list must be the final parameter.




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

Search: