Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Things I Don't Use in Perl

by Ovid (Cardinal)
on Aug 23, 2005 at 15:47 UTC ( #485945=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    sub name :lvalue { shift->name }
    # and later
    $object->name = 
      [qw/ random unvalidated value which breaks encapsulation /];
  2. or download this
    sub name {
      my $self = shift;
      return $self->{name} unless @_;
      $self->{name} = shift;
      return $self;
  3. or download this
    sub set_name {
      my $self = shift;
      croak "set_name() requires a name, silly!" unless @_;
      $self->{name} = shift; # insert other validation here
  4. or download this
    $object->id($id); # huh?
  5. or download this
    $object->set_id($id); # huh?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://485945]
Approved by Arunbear
Front-paged by Arunbear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2015-11-25 23:43 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (693 votes), past polls