Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: sub Prototype Syntax

by eyepopslikeamosquito (Chancellor)
on Apr 07, 2012 at 04:59 UTC ( #963885=note: print w/replies, xml ) Need Help??

in reply to sub Prototype Syntax

First, the code you posted has a syntax error in that you are missing a semi-colon after the first line below:

$template_string = $_[0] %internal = %{$_[1]};
There are also some stylistic oddities, such as using ALL CAPS for function names, calling the function with a leading &, and using prototypes (see next para), that caused me to pull a face -- though not errors they show dubious style IMHO.

Second, you probably shouldn't be using prototypes at all. For why not see:

This new 5.12 warning that you experienced is described in perl 5.12 perldelta (search for "prototype after"). It seems you can silence this warning by adding the line:

no warnings 'illegalproto';
after your "use warnings" line (I am assuming you are using strict and warnings). However, I doubt that blindly silencing this warning is a good idea because it is telling you that the prototype is invalid -- presumably because of the optional arguments after the '%' character (I don't use prototypes so I'm not certain of that). See perlsub for Perl prototype documentation. You can also make it go away by simply removing the prototype (recommended) or shortening it to just:

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963885]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2017-02-26 13:38 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (373 votes). Check out past polls.