Symbolic reference for oo method

David R. Waddell dave.waddell at mci.com
Fri Dec 5 16:47:47 CST 2003


All,
I tried it out. Trying to use symbolic refs
directly didn't work.

However, this does work:

Script TryOut:

#!/usr/local/bin/perl
use warnings;
use TryOut;
$tryer = new TryOut();

$Routine = "LD";
&$Routine;

sub LD{
         $tryer->LD
}

It dispatched to a parent class or TryOut:

/fraud/user/dwaddell/TryOut TryOut
Called Generic LD

To do this it looks like you have to put in an
extra dispatch using a symbolic reference. At
least all the attempts I tried besides this way
didn't work.
David

At 14:43 12/5/2003, David R. Waddell wrote:
>Hi All,
>Does anyone know off the top of their head whether
>symbolic references work for oo methods?
>
>I want to read a line from an tab-delimited table and call
>a routine like this:
>
>$self->&{$column_text}(param1, param2);
>
>so that if the text is 'LD', I would call this
>routine using oo dispatch:
>
>$self->LD(param1,param2);
>
>I couldn't find anything in the perl documentation about
>whether this would work.
>
>all the best,
>David




More information about the Pikes-peak-pm mailing list