A (probable) error in perltoot ( perl5/5.8.0/pod/perltoot.pod, line number 756 )

H

Himanshu Garg

Dear Perl Programmers,

I tried out the code given in :-

http://www.perldoc.com/perl5.8.0/pod/perltoot.html#Aggregation

The following line :-

printf "%s is really %s.\n", $him->name, $him->fullname;

gives the following output :-

Tommy is really Fullname=HASH(0x804c9b8).

This happens because fullname returns an object reference as follows :-

sub fullname
{
my $self = shift;
return $self->{FULLNAME};
}

Therefore the line should probably be :-

printf "%s is really %s.\n", $him->name, $him->fullname->as_string;

Please correct me if I am wrong.

Thank You
Himanshu.
 
H

Himanshu Garg

Dear Anno,

Thanks for the prompt reply. I have submitted the patch to bugs.perl.org.

Thank You
Himanshu.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top