Thomas Wittek skribis 2007-05-15  0:48 (+0200):
> > The Perl Way:
> > $ calls the method called "foo".
> > $object.$foo() calls the method that is in the variable $foo.
> My way:
> someref = &somemethod
> object.someref()
> Of course you could argue that you don't know in advance, if "object"
> has a method with that name, so you cannot manually avoid the conflict.

Indeed. Now you have to know your object very well, and avoid all of its
method names for variable names. For example, an HTTP::Request object
has a .headers method. If Your Way were in effect, I could no longer
safely use the name "headers" for my own variables, and then still call
the "headers" method on the object.

Perl allows both avoiding clashes and not-avoiding clashes. Your way
only strictly requires the former programming style. And since my
preferred style is different, I'm glad you're not designing Perl 6.
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  <>
  convolution:     ict solutions and consultancy <[EMAIL PROTECTED]>

Reply via email to