Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use Fruit; my $apple = new Fruit::Apple; print "\nAPPLE = $apple->{Value}"; $apple->increase; print "\nAPPLE = $apple->{Value}";
The error I'm getting is:use strict; package Fruit::Apple; sub new { my $class = @_; my $self = { Value => 0 }; bless $self, $class; return $self; } sub increase { my $self = shift; $self->{Value}++; } return 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
You're going to kick yourself...
by RMGir (Prior) on Apr 10, 2002 at 16:33 UTC | |
by JojoLinkyBob (Scribe) on Apr 10, 2002 at 16:54 UTC | |
|
Re: A Bad Day to OOP :(
by demerphq (Chancellor) on Apr 10, 2002 at 17:18 UTC | |
by chromatic (Archbishop) on Apr 11, 2002 at 04:09 UTC |