>    Show me the entire script or at least a better
>idea of what is in it than the outline given below.

The complete script is really toooo lengthy and that is the reson why I
have exactly given an outline.

Anyways again I'll explain what I'm looking for.

If you have observed in that code, the script has two command-line
options namely --class and --method.

<snip>
my $rc = GetOptions( "class|c=s"
                    ,"method|m=s"
                    ,"help|h|?"
                    ,"trace:i"
                   );
</snip>

That script is a test driver for some working code. The working code has
n number of classes and each has m number of methods. In this test
driver I have a test-suite (which is a method) for every method of every
class.

The test-suite (which is a method of our test driver) is named as
classname_methodname.

The user who executes this script needs to give the method name and
class name of which he needs to test and that's why --class and
--method....

Depending upon the class name and the method name our test driver should
call (or invoke) the appropriate test-suite.

Hope it is making sense now....:)

One way of doing it is having lot of if...else statements which I feel
is stupid.


That's why I have used symbolic reference to invoke the method

<snip>
{
no strict 'refs';
my $functionname = $options{class}."_".$options{method};

&$functionname;
}
</snip>

The reason why I enclose this in a BLOCK and put no strict 'refs' is,
the script has "use strict" pragma in use.

Again I repeat, as far as I have read in several docs, they insist on
not using symbolic references.

>    Did you write the script?

Yes.... And it is too lengthy and to be precise it is confidential also
and that's why I have given the outline.

>    Are you looking for a good solution or just something
>to get going? In other words are you just trying to crib
>something together to get up and running or are you
>looking for a good long-term solution?
>

What I'm looking at:
====================
Obviously a good long term solution. The reason why I have put up the
question in the mailing list is because many of you experts would have
faced similar situations and would have arrived at a better (may be...;)
solution and I'm hunting for a better solution.


With Best regards,
R. Kamal Raj Guptha.
Ph: 91-80-28411990 Ext:1296
Mobile - 9880351218


>-----Original Message-----
>From: Charles K. Clarkson [mailto:[EMAIL PROTECTED]
>Sent: Friday, November 26, 2004 1:23 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Calling functions using variable (I mean symbolic refs)
>
>
>[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>: Some one please do help me....
>:
>: I'm sure that there could be better solution and I'm
>: sure that someone would have faced a similar situation.
>:
>: Do let me know your best possible solution for this
>: scenario.
>
>    Show me the entire script or at least a better
>idea of what is in it than the outline given below.
>
>    Did you write the script?
>
>    Are you looking for a good solution or just something
>to get going? In other words are you just trying to crib
>something together to get up and running or are you
>looking for a good long-term solution?
>
>
>HTH,
>
>Charles K. Clarkson
>--
>Mobile Homes Specialist
>254 968-8328
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
><http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>



Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to