how to loop over instances of a class

F

fulko.hew

There has got to be a built in way to loop over all instances of a class.
But I can't find it.

ie.

foreach $y (MYCLASS::) {
$y->mymethod();
}
 
J

Jay Tilton

(e-mail address removed) wrote:

: There has got to be a built in way to loop over all instances of a class.

What have you read that makes you believe that?
 
B

Brian McCauley

Jeff Thies said:
Personally, I push a reference to it on an array.

Yep, and don't forget to Scalar::Util::weaken() it.

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top