Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Accessing Subroutine Arguments

by rjray (Chaplain)
on Apr 04, 2002 at 00:38 UTC ( [id://156511]=note: print w/replies, xml ) Need Help??


in reply to Accessing Subroutine Arguments

As the previous respondent pointed out, this is more in the area of personal style preference, but I also agree with him that the nature of the situation you describe lends itself to the hash-table/named-args approach.

When I write subroutines, I give some time to consider (a) the scope of the routine itself (not in the lexical sense, but in the sense of, "How big and significant is this likely to become?"), and (b) easy will it be to document clearly for the sake of other users? For that matter, the "other users" question can often be a deciding point-- one utility-script I package with RPC::XML uses long lists of parameters between routines, but no one else is going to use that routine independantly, it will only ever be part of the utility script (which harkens back to the "scope of use" question).

I realize this is no more a definative answer than the previous post was, because this is not an absolute cut-and-dried situation. However, just for arguments' sake, I'll say that in my opinion you should go with the hash-table approach for the situation you specifically describe.

--rjray

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-18 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found