Can someone help me understand how does one pass variable to a Perl test
script from the calling program? Is such a mechanism available? To
illustrate my question:

--------------------
main.pl
~~~~~~~

print "Running tests...\n";

my $var = 2;
runtests @tests;

---------------------
t\0.t
~~~~~

print "1..1\n";

print 1 + 1 == 2 ? "ok 1\n" : "not ok 1\n";
----------------------
t\1.t
~~~~~

print "1..1\n";

# $var = $main::var; #Can something like this be done, currently this does
not work for me

print $var == 2 ? "ok 2\n" : "not ok 2\n";
-----------------------

Please let me know if you have any suggestions on how to go about
implementing such a program.

Thanks in Advance

Rajesh Dorairajan

Reply via email to