in reply to Re: use fields, underscores and subclasses
in thread use fields, underscores and subclasses

> Perl gives the programmer only two things: @ISA and bless.

you forgot -> for blessed refs! 8 )

Cheers Rolf

  • Comment on Re^2: use fields, underscores and subclasses

Replies are listed 'Best First'.
Re^3: use fields, underscores and subclasses
by Anonymous Monk on Nov 23, 2008 at 01:45 UTC
    no he didn't, -> is for REFs, and @ISA/bless is for OO

      -> in general is for refs, but ->name is for OOP. It even works on more than refs.

      JavaFan also forgot the universal base class UNIVERSAL and the methods is provides.

        yes, but I wasn't sure if UNIVERSAL may already have a meaning for classical packages, with the methods called with ::

        well I'm too tired to look it up now ... vote me down guys .. good night!

        Cheers Rolf

      nope!

      -> has a special meaning for OOP to call with an included extra parameter ... the packagename or the selfref.

      just try ->name on a unblessed ref ...

      ...and log in again ;)

      perlop

      Otherwise, the right side is a method name or a simple scalar variable containing either the method name or a subroutine reference, and the left side must be either an object (a blessed reference) or a class name (that is, a package name).

      Cheers Rolf