On Thursday, April 18, 2002, at 07:54 , Chas Owens wrote:
[..]

p0: thanks for the clarification on the @_; since my coding
with that - like my habits with subs in general is based not
upon any sense of 'understanding or knowledge' - but based
solely upon

        a) ripped that off from someone
        b) it worked for me
        c) no observed dilitorious side effects

Hence, ok, to be honest I may have started with

        sub fooBar {
                my ($val1, $val2 ) = @_;
                ....
        }

and then 'extend that function' later on with say

        sub fooBar {

                my ( $val1, $val2, $val3 ) = @_;
                .....
        }

and if done right only the 'new ones' who actually pass
in a 3rd variable get any of the 'value' of that... the
ones passing in 2 args see no difference... but I am still
working on whether I 'like' this 'feature'.

> As for formal parameters in Perl 5.x, they come with massive caveats:
> only take effect if the sub is declared before it is seen in code, if
> you say &subname() then the parameter definitions are ignored, the
> parameter check is only done at compile time so it is useless for OO
> code, and a pack of other warnings.  I really hope they straighten out
> this mess for Perl 6 (from what I have been reading it looks like they
> have).

p1: which I guess is my other question - here, I grew under the
tutelage of the

        use vars qw/<var list>/;
        use subs qw/<sub list>/;

        .....
        # some subs

        # the main loop

and the idea of doing some form of 'predeclaration' with formal
arguments would not seem an enhancement unless I really got the
correct sort of compile time optimization....

So my summary seems to be:

        Neat idea - may get cleaned up in perl6
        back in line behind my Seth and not to go there....


ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to