Title: Message

Hi,

 

There's not a spotty problem there, just a syntax ambiguity.  The "method object" syntax is deprecated for this reason.

 

The clearest and simplest explanation of this I can lay my hands on immediately is in the Perlobj manpage:

 

Here is Activestate's copy if you don't have them handy:

 

http://aspn.activestate.com//ASPN/Products/ActivePerl/lib/Pod/perlobj.html#method_invocation

 

See the section on "Indirect Object Syntax".

 


-Jordan Henderson


The common idea that success spoils people by making them vain, egotistic, and self-complacent is erroneous; on the contrary it makes them, for the most part, humble, tolerant, and kind.  Failure makes people bitter and cruel.
-- W. Somerset Maugham

-----Original Message-----
From: JY - June Young [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 10:13 AM
To: [EMAIL PROTECTED]
Subject: problem of use "new Classname" to create object

 

Hi, all,

 

I run into the following error while runing our CGI in Apache mod_perl

 

Undefined subroutine &BookReqComObj::BookingRequest called at
     /APACHE$ROOT/000000/bin/BOOKREQ_COM OBJ.PL line 149 during global destruction.

 

     The line 149 is
       my $req = new BookingRequest($items->{$_});

 

     The workaround is
       my $req = BookingRequest->new($items->{$_});
     and tested OK.

 

First I thought it is mod_perl issue, then my colleague told me that Perl has always had a problem with creating objects inside of other objects. Its a spotty problem.  Sometimes it works sometimes it doesn't.  She never been able to isolate the actual cause. 

 

I could not find any relevant documentation from the web or reference books I have. Does anyone run into the same issue? Is this a perl bug or common knowledge that should always use "Classname->new" to create new object?

 

Thanks,

June Young, Software Development bus: (902)422-1973 x144

Dymaxion Research Ltd., 5515 Cogswell St., fax: (902)421-1267

Halifax, Nova Scotia, B3J 1R2 Canada mailto: [EMAIL PROTECTED]

http://www.dymaxion.ca <http://www.dymaxion.ca/>

Reply via email to