vit has asked for the wisdom of the Perl Monks concerning the following question:
When I call in outside I dopackage TEST; .......... sub new { my $class = shift; my $self = {@_}; bless $self, $class; return $self; } sub xxx { my $self = shift; my $par = shift; return $par; }
If I do it inside package I have to put something for the first parameter and if I do it this way it worksmy $obj = new TEST(); print $obj->xxx("hi")
Is it a right way or do I violate something?print xxx("", "hi");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling method inside and outside of package
by kcott (Archbishop) on Oct 28, 2010 at 18:29 UTC | |
|
Re: Calling method inside and outside of package
by chromatic (Archbishop) on Oct 28, 2010 at 20:31 UTC | |
|
Re: Calling method inside and outside of package
by lyklev (Pilgrim) on Oct 28, 2010 at 19:50 UTC |