develooper Front page | perl.perl5.porters | Postings from December 2003

Re: [DOCPATCH] BEGIN, CHECK, INIT, END explained more

Thread Previous | Thread Next
From:
Ronald J Kimball
Date:
December 1, 2003 07:03
Subject:
Re: [DOCPATCH] BEGIN, CHECK, INIT, END explained more
Message ID:
20031201143225.GA3757@penkwe.pair.com
On Sun, Nov 30, 2003 at 09:52:37PM -0800, Yitzchak Scott-Thoennes wrote:
> On Sun, Nov 30, 2003 at 10:13:40PM +0200, Enache Adrian <enache@rdslink.ro> wrote:
> > 
> > $ perl -e 'foo { bar => "baz" }'
> > Can't locate object method "foo" via package "bar" (perhaps you forgot to load "bar"?) at -e line 1.
> > $ perl -MO=Deparse -e 'foo { bar => "baz" }' | perl
> > -e syntax OK
> > Can't locate object method "foo" via package "baz" (perhaps you forgot to load "baz"?) at - line 1.
> > 
> > Or maybe Perl itself is wrong ?
> 
> No, you are feeding it indirect object syntax ("method object") where
> object is a BLOCK.  Deparse is just showing it as the equivalent ->
> method call.

But it's not equivalent; the error messages differ.

Ronald

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About