On Jul 19, Beast said:
package Test;
sub new {}
sub f_one{}
sub f_two{}
You've neglected to show us the contents. I'll assume that new() creates
and returns an object. I'll also assume that f_one() and f_two() DO NOT
return objects.
my $test = Test->new->f_one;
Test->new returns an
Beast <[EMAIL PROTECTED]> asked:
> I can call using
>
> my $test = Test->new->f_one;
Test->new returns an object of type Test; and so your code
is equivalent to
my $obj = Test->new;
my $test = $obj->f_one;
> But why this not works?
>
> my $test = Test->new->f_one->f_two;
This will work if f_
Perl Object Oriented Programming is very confusing (to me at least :)
---
package Test;
sub new {}
sub f_one{}
sub f_two{}
1;
---
I can call using
my $test = Test->new->f_one;
But why this not works?
my $test = Test->new->f_one->f_two;
--
--beast
--
To unsubscribe, e-mail: [E