Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Concatnate long statement

by snopal (Pilgrim)
on Jul 04, 2007 at 00:39 UTC ( [id://624809]=note: print w/replies, xml ) Need Help??


in reply to Concatnate long statement

I prefer:
my %args = ( eqpid => $eqpid, chamber => $chamber, lotid => $lotid, wafer_flow => $wafer_flow, recipe => $recipe, wafer_slot => wafer_slot, # etc. ); sub_call(%args); sub sub_call { my %args = shift; # do some validation # do some work }

The advantage is that no one (including you) who comes in later has to remember parameter order in the call. The actual structure is sitting right there in the open, and the code is much more self-documenting.

Replies are listed 'Best First'.
Re^2: Concatnate long statement
by fenLisesi (Priest) on Jul 04, 2007 at 07:03 UTC
    my %args = shift;

    ?

      Ah yes, my freeform entry technique sometimes fails me:

      sub_call(\%args); sub sub_call { my $arg_of = shift; }

      Using a HASHREF makes so much more sense as well.

      Thanks for the nice catch.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found