Thank you, Andrew. 
Andrew, pointed out that Perl provides a way to delay the resolution of a
method.

>Date: Sun, 19 Aug 2001 20:04:12 -0700 (PDT)
>From: Andrew Ho <[EMAIL PROTECTED]>
>
>George,
>
>>GS>In other words, I would like all my reference to be hard method
>>GS>references which are developed from string scalars at run time (delayed
>>GS>resolution and later dereferenced).
>>
>Perl allows you to delay resolution of a method until run-time: 
> 
> $method = 'foo'; 
> $object->$method($a, $b, $c)
>Humbly,
>
>Andrew
>
>----------------------------------------------------------------------
>Andrew Ho               http://www.tellme.com/       [EMAIL PROTECTED]

NOTE:
Above, I should have said "subroutine" in place of the word "method", since
"method" implies OO referent calls.  Also, I did not understand "delayed
resolution". (My mistake.)

I choose to implement the following (snip): 

        no strict 'refs'; 
        $Commands{$command}{cmd}=\&$routine;  # $routine contains a string
        use strict 'refs'; 
        unless(defined &{$Commands{$command}{cmd}}) { 
                delete $Commands{$command}; # This is bad, so throw it away! 
                warn "$routine routine is not defined"; 
        }

for a couple of reasons. 
1) The methods are not OO (yet). 
2) The above assignment only happens during initialization.

[I learned a lot about OO Perl.]
Again, thanks, [done]

+=======================================+
| George Sanderson <[EMAIL PROTECTED]> |
| <http://www.xorgate.com/>www.xorgate.com                       |
+=======================================+  

Reply via email to