Hi Wise monks !!
I hav a problem in using Modules dynamically..
I have written a script which will fetch all the module names (*.pm) from a particular directory and its sub-dirs .
Now I hav all these names in an array and i need to call a method table_name defined in those modules.
Heres the pseudo-code form of my script .. step 1 : Getting all .pm filenames from a directory that satisfies a p +articular condition. ( in an array ) step 2 : Traverse through the array of filenames and use the module dy +namically
Something lik this ;
This is jus a snippet of my script; my @tables; foreach my $modulenames ( @avail ) { my $object = "Project::$modulenames"; use $object; my $objvalue = $object->table_name(); push (@tables, $objvalue); } print "@tables";
The Problem i hav now is I can't use my modules dynamically something like use $object ;
Thanks in advance !!!
Vishi83
In reply to Getting Module Names Dynamically and using it by vishi83
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |