SPUG: Choosing an object's method at runtime

Marty D. Cudmore marty.d.cudmore at boeing.com
Wed May 24 11:13:00 CDT 2000


Using the $obj->$meth() syntax is the ONLY way, I've ever gotten this to work.  I'm not sure of a manpage, but the syntax is outlined on page 254 of the Camel under Symbolic References.

Cheers,

Marty


----------
From: 	Sanford Morton[SMTP:smorton at pobox.com]
Sent: 	Tuesday, May 23, 2000 5:31 PM
To: 	spug-list at pm.org
Subject: 	SPUG: Choosing an object's method at runtime

I'm feeling particularly dense today. I want to choose an object's
method at run time:
  $object = new Some_Class;
  $method = 'stop';
But then
  $object->$method;
gets a syntax error, whereas
  $object->$method();
seems not to.

Does anyone know which man page covers this? I'm clueless. I need more
sleep. --Sandy


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 For Subscriptions, Email to majordomo at pm.org:  ACTION  spug-list  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address




 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 For Subscriptions, Email to majordomo at pm.org:  ACTION  spug-list  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address





More information about the spug-list mailing list