in reply to Re^3: warnings and strict -- The 2 Best Ways You Can Improve Your Programming
in thread warnings and strict -- The 2 Best Ways You Can Improve Your Programming

I hadn't considered that argument, but it makes a lot of sense.  I can see where passing @list would now be prohibited because of a narrowing of definition of what passed parameters are legal.

Since I still prefer to put subroutines at the end of the file, and call them with the simpler my $result = function $a, $b, $c; (or my $result = function @abc_list;), I will try to stick to using prototypes like:  sub ratio_change; where the argument list (and parens) are unspecified.

  • Comment on Re^4: warnings and strict -- The 2 Best Ways You Can Improve Your Programming

Replies are listed 'Best First'.
Re^5: warnings and strict -- The 2 Best Ways You Can Improve Your Programming
by Perl Mouse (Chaplain) on Oct 05, 2005 at 14:12 UTC
    There's no prototype in:
    sub ration_change;
    That's a (forward) declaration. If you use a prototype, both the declaration, and the definition of the subroutine should have prototypes, and the prototypes should be identical.
    Perl --((8:>*
      You're right ... I stand corrected. ;-)