in reply to Re^2: passing array of args to prototyped subs
in thread passing array of args to prototyped subs

I realize that the community doesn't seem to like prototypes

Well — not exactly. The Perl community is fine with prototypes when they’re used appropriately. The problem is, most of us come to Perl with a background in C/C++/Java, see Perl prototypes, and think, “That must be Perl’s way of doing argument checking.” But prototypes have little to do with argument checking; they are all about argument coercion.

This is explained in detail in the classic article Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen (written by the co-author of the Camel Book, no less). That article is a must-read for every Perl programmer.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

  • Comment on Re^3: passing array of args to prototyped subs

Replies are listed 'Best First'.
Re^4: passing array of args to prototyped subs
by pldanutz (Acolyte) on Sep 10, 2013 at 08:31 UTC
    Thanks a lot. That article *really* helped.

      The article also gives you the answer to your original question:

      print &f2 (@a) . "\n";

      even if you probably do not want to know it anymore...