Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Function Prototypes

by AnomalousMonk (Archbishop)
on Nov 25, 2015 at 05:10 UTC ( [id://1148574]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Function Prototypes
in thread Function Prototypes

I still do not understand your original reasons for wanting to use prototypes, nor do I know if hippo's reply has dissuaded you, but if you are not dissuaded, here's an example of why prototypes are not useful as you seem to wish to use them:

c:\@Work\Perl\monks>perl -wMstrict -le "use Data::Dump qw(dd); ;; sub S_ { my %h = @_; dd \%h; } sub Sh (%) { my %h = @_; dd \%h; } sub Sa (@) { my %h = @_; dd \%h; } ;; S_(qw(a b c)); Sh(qw(a b c)); Sa(qw(a b c)); " Odd number of elements in hash assignment at -e line 1. { a => "b", c => undef } Odd number of elements in hash assignment at -e line 1. { a => "b", c => undef } Odd number of elements in hash assignment at -e line 1. { a => "b", c => undef }
The warning is in the  'misc' class, and escalating such warnings to FATALity would at least prevent the code from soldiering on regardless, but of course that has nothing to do with the prototype.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148574]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found