YAPC::2004::Israel << Previous | Index | Next >> Copyright © 2004 Gaal Yahas

Who needs to implement fields in many ways?


  • The majority of users (OOP programmers) don't need creative fields

    • (most of the time)

  • Fields are usually constructed as hash elements:

     package TrafficLight;
     sub new {
         bless { colour => 'red' };
     };
  • And used as such in client code.

     $light = TrafficLight->new();
     $light->{color} = 'green';

That's the way it's done at least 92.7% of the time on CPAN