> "JG" == Jenn G writes:
JG> On Tue, Aug 11, 2009 at 2:33 PM, Uri Guttman wrote:
>>> "JG" == Jenn G writes:
>>
>> JG> When I create a package, and call its methods by both object way and
>> JG> function (exported) way, how to avoid the conflict in arguments
>> JG> passing
On Tue, Aug 11, 2009 at 05:45, Jenn G. wrote:
> On Tue, Aug 11, 2009 at 2:33 PM, Uri Guttman wrote:
>>> "JG" == Jenn G writes:
>>
>> JG> When I create a package, and call its methods by both object way and
>> JG> function (exported) way, how to avoid the conflict in arguments
>> JG> passing
On Tue, Aug 11, 2009 at 2:33 PM, Uri Guttman wrote:
>> "JG" == Jenn G writes:
>
> JG> When I create a package, and call its methods by both object way and
> JG> function (exported) way, how to avoid the conflict in arguments
> JG> passing?
>
> why are you trying to do OO and procedural call
On Tue, Aug 11, 2009 at 02:14, Jenn G. wrote:
> Hello,
>
> When I create a package, and call its methods by both object way and
> function (exported) way, how to avoid the conflict in arguments
> passing?
snip
Short answer: don't do that.
Medium answer:
Mixing procedural and OO style in the same
my $self = shift;
JG> my @arg = @_;
my( $self, @args ) = @_ ;
that is cleaner, faster and better.
JG> ...
JG> }
JG> __END__
JG> But for function calling, "my $self = shift;" shouldn't be used.
JG> So how to make both function calli
{
my $self = shift;
my @arg = @_;
...
}
__END__
But for function calling, "my $self = shift;" shouldn't be used.
So how to make both function calling and object calling work together?
Thanks.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional c