On Mon, Sep 25, 2000 at 05:49:21PM -0700, Nathan Wiger wrote:
> Michael Fowler wrote:
> > Honestly, if you're using both a stat class and a stat function in your
> > code it's up to you to keep it straight
> 
> Exactly my point. So why is this
> 
>    stat->mode
> 
> Any different? It's not.

Yes, it is, because you are not necessarily the only one who has control
over whether or not there is a stat function in the current namespace.  Or,
on a more complex level, whether or not your parent class has subroutines by
the same name as you.

 
> >     stat->{'mode'}; # call stat(), access the mode key
> >     stat->mode;     # call the mode method in the class 'stat'

Actually, under RFC244 stat->{'mode'} should be stat()->{'mode'}, so this
issue is moot, and that last example would have problems.  You are forced to
disambiguate.



> Try this code:
> 
>    print header . "\n";
>    use CGI qw/:standard/;
>    print header . "\n";
> 
> So you're claiming that's not action at a distance? You're completely
> wrong. The same exact mechanism causes 'Class' to become Class() -
> modules exporting functions into your namespace.

I guess I will repeat myself, and I quote:

        $time = time;
        print;

    If use strict 'subs' is in effect you're guaranteed these are subroutine
    calls, or compile-time errors.  If it isn't you get a nice little
    warning.  Perhaps the stringification should be removed entirely, and
    the syntax always be a subroutine call.

Notice the last sentence.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to