I'm trying to create an object dynamically using a string as the object type. It works for me with a simple example:
my $string = "Employee";
my $objct = new {$string}("Firs t", "Last", 12345);
Employee is a derived class of a Person class. However, with my real code I get an error: Compilation failed in require at studyMngr.pm line 7. The line triggering it is:
my $nextStepbjct = new {$nextProcessSt ep}("name");
Line 7 in this file (studyMngr.pm) has use SomeFile.pm.
What's the difference between the two ways of using a dynamic object is beyond me.
I'm on a deadline with this code. Help....
my $string = "Employee";
my $objct = new {$string}("Firs t", "Last", 12345);
Employee is a derived class of a Person class. However, with my real code I get an error: Compilation failed in require at studyMngr.pm line 7. The line triggering it is:
my $nextStepbjct = new {$nextProcessSt ep}("name");
Line 7 in this file (studyMngr.pm) has use SomeFile.pm.
What's the difference between the two ways of using a dynamic object is beyond me.
I'm on a deadline with this code. Help....
Comment