Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Prototypes in Perl are <a href="http://www.modernperlbooks.com/mt/2009/08/the-problem-with-prototypes.html" rel="nofollow">bad news</a>. They're terribly broken. Actually, they work perfectly, but our mere mortal brains cannot contemplate the full depth of Perl prototypes.</p> <p>They're suppose to allow you to call a user defined function as if it was a built-in function, but how they work is extremely confusing. See <a href="http://perldoc.perl.org/perlsub.html#Prototypes" rel="nofollow">Perldoc persub</a> for how they work (and don't work).</p> <p>There's been a movement for a while to remove parentheses from Perl function calls, and I guess in some circumstances, removing extraneous parentheses can make the code a wee bit easier to read. However, this tiny <em>improvement</em> isn't big enough to overcome the pitfalls of prototyping.</p> <p>You're definitely looking at the limits of prototyping. In fact, your code is actually quite confusing, and adding parentheses would improve its readability. Yes, I know that's not your purpose. Your purpose is to contemplate Perl prototyping until you become one with Larry Wall. I appreciate your courage. I experimented with prototyping until I ran crying into my bedroom, slammed the door, and refused to come out until supper. It took years of psychotherapy and heavy drinking to overcome my experience with Perl prototyping. Even today, I'll weep uncontrollably whenever I see <code>\@@</code>.</p> <p>Perl 6 is suppose to make everything all better. Unfortunately, Perl 6 has been in the works longer than <em>Duke Nukem Forever</em>. </p> <p>Slight exaggeration. <a href="http://en.wikipedia.org/wiki/Duke_Nukem_Forever" rel="nofollow">Duke Nukem</a> was actually announced in 1997 while Perl 6 was announced in 2000, so Duke Nukem actually has about three years on Perl 6. But then, Duke Nukem actually has a release date (June 2011) which is more that Perl 6 has.</p> <p>Okay, enough griping. You're probably better off looking on the <a href="http://www.perlmonks.org/" rel="nofollow">Perlmonks</a> site for help. That's where the Perl gurus hang out. They can probably explain everything going on with your program and why it's doing exactly the right thing.</p> <blockquote> <p>David Weintraub</p> <p>perl -e 'print "Just another second rate Perl hacker\n";'</p> </blockquote> <hr> <h1>ADDENDUM</h1> <p>Seems like the <em>Far More than Everything You've Ever Wanted to Know about Prototypes in Perl</em> has been moved to <a href="http://www.perlmonks.org/?node_id=861966" rel="nofollow">Perl Monks</a>. That's the article that will explain why your prototypes are behaving <em>as expected</em>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload