Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Your named arguments

by etcshadow (Priest)
on Nov 08, 2005 at 04:57 UTC ( #506607=note: print w/replies, xml ) Need Help??


in reply to Your named arguments

By the standard we use where I work, it would look like this:
sub convert { my ($args) = @_; AssertRequiredFields($args, [qw( from to thing )]); AssertValidFields( $args, [qw( from to thing )]); ... }
where AssertRequiredFields and AssertValidFields are fairly obvious core utility functions (which confess if the assertion is invalid), and $args is a hashref.

Yes, I know that it looks a little outdated... However, even though the codebase is under active development, some of it is still very old. Since nobody really feels like going back and retrofitting a million lines of code, we continue with the old (but still pretty good) standard.

------------ :Wq Not an editor command: Wq

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://506607]
help
Chatterbox?
stevieb is writing a little CUFP on how to control analog pins on an arduino from a Linux machine via I2C in light of Perl, JavaScript and Strandbeests. It also is a good real-world use-case to test my I2C dist.
[stevieb]: I just don't feel like going hardcore on anything today, so I thought I'd *use* my software instead of just write it

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-07-21 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (336 votes). Check out past polls.