Deal of the Day

Home » Main » Manning Forums » 1999 » Object Oriented Perl

Thread: erratum p.340

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 0 - Pages: 1 Threads: [ Previous | Next ]
CementFinger

Posts: 1
From: Regensburg
Registered: 5/27/04
erratum p.340
Posted: May 28, 2004 9:34 AM
  Click to reply to this thread Reply

In the recursive call of the pop() method, $self doesn't have to be passed, since it isn't touched in the callee:

return $self->{left}->pop($self) if defined $self->{left};

That would wind up in $_[1]. That doesn't hurt, of course, but I think it adds confusion in an already hard to grok example. So I suggest:

return $self->{left}->pop if defined $self->{left};

Legend
Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff