in reply to Re^4: Can you tell what $$$\@ means?
in thread Can you tell what $$$\@ means?

Re: Are prototypes evil? has a pretty good explanation (as well as the discussion to same author's When to use Prototypes?). You can't reliably use prototypes for argument validation since that's not what they do; they only coerce the context the value is placed in. sub foo ($) doesn't mean that you can only call foo( $scalar ), but that whatever argument you do pass will be put in scalar context. That means that foo( bar() ) for some bar which is context sensitive isn't going to do what you expect unless you're intimately familiar with foo's prototype. No errors will be raised, no warnings will be generated, but the behavior will be different than the norm.

Or another example: given sub baz ($$$) and my @a = qw( a b c ), you can't just call baz( @a ) you have to explicitly write baz( $a[0], $a[1], $a[2] ). There's 3 arguments available, it may make perfect sense to keep them grouped in an array, but because of the prototype you've got to go through extra hoops and write more code.

This is why the conventional wisdom is to avoid them unless you're explicitly trying to mimic a builtin. If you want argument validation, there's better ways to do so.

The cake is a lie.
The cake is a lie.
The cake is a lie.