News for hackers. Stuff that matters.
Re:Why I Use Perl: Reliability by zem on Tuesday May 29, 2012 @04:40PM (#4039725)
that also highlights one of my perl peeves - having to scrape function args out of @_ rather than declaring them as part of the function definition.
Re:Why I Use Perl: Reliability by jbert on Tuesday May 29, 2012 @04:47PM (#4039781)
Yes, that sucks. It's not much extra typing:

def function(x, y, z):

versus

sub function { my ($x, $y, $x) = @_; }

The overhead is only really the 'my = @_;' chars, but it is annoying. On the other hand, it does allow you to do things like partially unpack args and pass the rest as a bundle to a super class.

Re:Why I Use Perl: Reliability by pyre on Tuesday May 29, 2012 @07:24PM (#4040520)
You can partially unpack in Python too:

  def method(self, *args):
    a, b = args[:2]
    super(self).method(*args[:2])
Perl's lack of using the definition for the variables doesn't necessarily make it 'more powerful.'
Re:Why I Use Perl: Reliability by chromatic on Wednesday May 30, 2012 @02:36AM (#4041691)
Python's approach is very reasonable. Both Perl and Python are nicer than C varargs.
Re:Why I Use Perl: Reliability by gamache on Tuesday May 29, 2012 @05:51PM (#4040155)
It's really not that different; you just end up declaring your input arguments one line lower than in most other languages. Not a big deal in practice.

And with @_, you're free to use positional arguments, named arguments, variable arity, etc. without penalty. Some languages only give you some of that.

Re:Why I Use Perl: Reliability by berntb on Tuesday May 29, 2012 @05:00PM (#4039861)
Most of your life's problems can be solved at CPAN. :-) Just write:

  use Method::Signatures::Simple;
http://search.cpan.org/~rhesa/Method-Signatures-Simple-1.02/...

But you might instead want to look at this (or similar with Moose support) to get simple type declarations:

http://search.cpan.org/~barefoot/Method-Signatures-20120523/...