I am trying another way of calling a subroutine in a Perl script.
I have a feature set as follows:
sub Testcase_CheckStatus {
print "TestCase_CheckStatus called\n";
}
Then I look at the Perl hash with keys like "CheckStatus":
while (my ($k, $v) = each %test_cases) {
print "TestCase_$k","\n";
Testcase_$k();
}
Basically, I want to call the Testcase_CheckStatus function, as shown above, when analyzing the hash keys, but I get this error:
Cannot find the method of the object "Testcase_" through the package "CheckStatus" (maybe you forgot to download "CheckStatus"?) In. /main.pl line 17
What can I do to fix this problem? Is there an alternative way to do the same?
source
share