ant has asked for the wisdom of the Perl Monks concerning the following question:
In shapes.pmuse shapes; my %box; $box{line1} = ' ---'; $box{line2} = '| |'; $box{line3} = ' ---'; my $box = shapes->new(shape => %box); exit();
package shapes; #constructor sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { shape => {}, }; return bless $self, $class; } sub print_shape { my $self = shift; print $self->{shape}{line1} . "\n"; } 1
Janitored by Arunbear - retitled from 'box trouble?!'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble getting started with Perl OO
by zejames (Hermit) on Oct 07, 2004 at 11:56 UTC | |
|
Re: Trouble getting started with Perl OO
by pernod (Chaplain) on Oct 07, 2004 at 12:08 UTC | |
by ant (Scribe) on Oct 07, 2004 at 12:24 UTC | |
|
Re: Trouble getting started with Perl OO
by gothic_mallard (Pilgrim) on Oct 07, 2004 at 12:29 UTC | |
|
Re: Trouble getting started with Perl OO
by Roger (Parson) on Oct 07, 2004 at 12:25 UTC | |
by demerphq (Chancellor) on Oct 07, 2004 at 13:23 UTC | |
by Anonymous Monk on Oct 07, 2004 at 12:43 UTC | |
by Roger (Parson) on Oct 07, 2004 at 12:55 UTC | |
|
Re: Trouble getting started with Perl OO
by periapt (Hermit) on Oct 07, 2004 at 11:52 UTC |