in reply to Implementing State pattern
You didn't include an accessor in dstatenorm to fetch the NAME.
package dstatenorm; ... sub name { my $self = shift @_; return $self->{NAME}; }
Then in your code, request the name of the state.
print $driver->alertness->namePS: don't use prototypes especially when writing object oriented code.
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Implementing State pattern
by Justin_BSI (Acolyte) on May 02, 2006 at 23:39 UTC |