Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Function Prototypes

by KimberTLE (Initiate)
on Nov 24, 2015 at 18:19 UTC ( [id://1148521]=note: print w/replies, xml ) Need Help??


in reply to Re: Function Prototypes
in thread Function Prototypes

You, hippo, are my hero! And now that I see it, it makes perfect sense. Occam's Razor, after a good stropping. As promised: THANK YOU!

Replies are listed 'Best First'.
Re^3: Function Prototypes
by Your Mother (Archbishop) on Nov 24, 2015 at 18:32 UTC
      Thanks! Own it, and I've read it. But messing with "named arguments" raised the question in my mind, "how would you prototype something like this?" And after too many sleepless millennia, I relented and had to ask! But kind of like...
      Paris in the the spring time
      Once you've written it, the correct answer eludes you forever. Again, thanks for supplying the two-by-four. Greatly appreciated!
Re^3: Function Prototypes
by AnomalousMonk (Archbishop) on Nov 25, 2015 at 05:10 UTC

    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://1148521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-28 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found