Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And I have this test script.package Sample_Test; use strict; use Exporter; our $VERSION = 1.00; our @ISA = qw( Exporter ); our @EXPORT = qw(); sub New { my $class = shift; my $self = { user => 'me', num => '123', }; bless( $self, $class ); return $self; } sub _Print_Me { my ($self) = @_; print $self->{user}; } sub Show_Me { my ($self) = @_; return _Print_Me(); } 1
When I run it, it only gives me the output from $object->Show_Me(). I think it is obvious why it is not working, but I cannot just figure it out.#!/usr/bin/perl use warnings; use strict; use Sample_Test; my $object = Sample_Test->New(); $object->_Print_Me(); $object->Show_Me();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Simple OO Question
by Corion (Patriarch) on Sep 15, 2010 at 22:20 UTC | |
by DStaal (Chaplain) on Sep 16, 2010 at 13:02 UTC | |
by dsheroh (Monsignor) on Sep 16, 2010 at 13:21 UTC |