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

Re: Accessing Subroutine Arguments

by rjray (Chaplain)
on Apr 04, 2002 at 00:38 UTC ( #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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2021-04-20 23:33 GMT
Find Nodes?
    Voting Booth?

    No recent polls found