CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Tumata] Problem to call an object method on objects collected in an arry: Edit Log



framp
Novice


Apr 10, 2009, 5:05 AM


Views: 3155
Re: [Tumata] Problem to call an object method on objects collected in an arry

Thank you very much Tumata for your reply.

Class::Std requires to define a sub BUILD which is called under the cover when a ctor is called for a class. So the following code is the actual ctor:


Code
my ( $self, $ident, $arg_ref ) = @_;  
$collectorList{ ident $self} = ();
print "*** colletcorList after initialization\n";
print Data::Dumper->Dump([$collectorList{ident $self}]);
return;


See http://search.cpan.org/~dmuey/Class-Std-0.0.9/lib/Class/Std.pm for details.

I added a Dumper statement just before the foreach loop and get


Code
$VAR1 = bless( do{\(my $o = undef)}, 'InterfaceCollector' ); 
$VAR2 = bless( do{\(my $o = undef)}, 'InterfaceCollector' );


so the collectorList is filled with InterfaceCollectors and should be able to accept 'collect' calls.

"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds, 28.9.2003

(This post was edited by framp on Apr 10, 2009, 5:21 AM)


Edit Log:
Post edited by framp (Novice) on Apr 10, 2009, 5:21 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives