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

Re: Re: Re: Re^2: There's a level in Hell reserved for ________

by perrin (Chancellor)
on Mar 11, 2003 at 20:11 UTC ( #242137=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re^2: There's a level in Hell reserved for ________
in thread There's a level in Hell reserved for ________

I've always used this style for args:
my_function_call( $arg1, $arg2, $arg3, );
And for really long ones that would wrap, I do something like this:
My::Module::With::Really::Long::Name::and_function_call( $arg1, $arg2, $arg3, );
Keeping each arg on a separate line makes them easy to read and easy to change, in my opinion. It is the most common style I've seen in use by experienced Perl programmers.

Replies are listed 'Best First'.
Re^5: There's a level in Hell reserved for ________
by Aristotle (Chancellor) on Mar 15, 2003 at 11:17 UTC
    I always write them like so:
    my_function_call( $arg1, $arg2, $arg3, );
    I indent all blocks, whether they be code, anonymous array/hash constructors, parameter (or other) lists, or anything else in the same way. Makes a lot of sense, if you ask me, when you're nesting calls:
    my_function_call( my_other_function_call( $arg1, $arg2, and_yet_one_more_function_call( $arg1, $arg2, $arg3, ), ), $arg2, $arg3, );
    my_function_call( my_other_function_call( $arg1, $arg2, and_yet_one_more_function_call +( + $arg1, + $arg2, + $arg3, +), ), $arg2, $arg3, );
    Yuck, if I may say so.

    Makeshifts last the longest.

Re: Re: Re: Re: Re^2: There's a level in Hell reserved for ________
by Anonymous Monk on Mar 15, 2003 at 15:25 UTC
    I do as Aristotle does. That way if I have to change the line on which the function call is made, I don't have to reindent the arguments.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://242137]
[Lady_Aleena]: Thanks Corion.
[Lady_Aleena]: This is one of my oldest accounts on the web. 8)
[Corion]: Lady_Aleena: Hehe - I think this is also my oldest active account on the web. I have an old university email address but that only gets spam nowadays :)
Discipulus arrived at work 1 hour late.. he do not noticed the clock bell
[Lady_Aleena]: My Wikipedia account is 3 years - 10 days younger.
[fux]: Hi folks:) Lady_Aleena: congrats!
vrk takes a handful of cookies from the platter on the sideboard.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-04-26 07:42 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (470 votes). Check out past polls.