[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [PATCH lib/lib.pm 5.005_63] Removing use of vars.pm
Martyn Pearce writes:
: Larry Wall writes:
: | I see you usually did
: |
: | our($FOO, $BAR, $BAZ);
: | $FOO = "foo";
: | $BAR = "bar";
: | $BAZ = "baz";
: |
: | and sometimes you did
: |
: | our $FOO = "foo";
: | our $BAR = "bar";
: | our $BAZ = "baz";
: |
: | I think I have a slight preference for the latter because it encourages
: | people to initialize. I presume your usual preference for the former
: | can be explained by ease of editing (and possible unediting :-).
: |
: | I almost never use C<my> with a list either. It's possible I'm ashamed
: | of the parentheses despite their pragmatic necessity.
:
: I wonder why? In comparison to the two above, I tend to go for
:
: my ($FOO, $BAR, $BAZ) = ("foo", "bar", "baz");
:
: being both concise and initializing.
The problem with that is the separation between the variable name and
its value. And the more elements in the list, the worse it gets.
Larry
- Follow-Ups from:
-
Pete Jordan <pjordan1@email.mot.com>
- References to:
-
Martyn Pearce <martyn@inpharmatica.co.uk>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]