Ask a Question related to PERL Miscellaneous, Design and Development.
-
Himanshu Garg #1
A (probable) error in perltoot ( perl5/5.8.0/pod/perltoot.pod, line number 756 )
Dear Perl Programmers,
I tried out the code given in :-
[url]http://www.perldoc.com/perl5.8.0/pod/perltoot.html#Aggregation[/url]
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.
Himanshu Garg Guest
-
Inserting Line Number
I would like to insert line numbers for all the files in a directory. So if a directory contains files like foo.c, foo.c1, foo.c2, foo.c3, foo.c4,... -
Get number of line with error
Hi all. I want ask you it exist some way how to get number of line in script producing error. for example: .... .... 100 ... -
Error message line number in subs
I have an interactive perl cgi programlet, which allows some graphics for interactively typed and executed perl programs: ... -
make error with DBD-ODBC-1.0.3 for perl5.8 on HPUX11.11
Environment: HP B.11.11 perl 5.8 installed successfully,DBI-1.3.0 installed succesfully. when we tried to install DBD-ODBC-1.0.3,we followed the... -
Error line number
Hi Newsgroup, A very short question: If have a try/catch structure. In the catch part I would like to get the line number where the exception... -
Anno Siegel #2
Re: A (probable) error in perltoot ( perl5/5.8.0/pod/perltoot.pod, line number 756 )
Himanshu Garg <himanshu@gdit.iiit.net> wrote in comp.lang.perl.misc:
Looks like you're right. Not a biggie, but you could send in a patch.> Dear Perl Programmers,
>
> I tried out the code given in :-
>
> [url]http://www.perldoc.com/perl5.8.0/pod/perltoot.html#Aggregation[/url]
>
> 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.
Anno
Anno Siegel Guest



Reply With Quote

