in reply to Re^2: using a variable with require
in thread using a variable with require
Your question already seems to be solved, but I thought I'd post a note with respect to your original problem and the use case you're describing here. The name of the file and the name of the package inside it isn't necessarily related. That's one of the difficulties that I expect Grandfather and others were thinking about.
So one thing you can do is use the same package name for all of your podcast processors. Then you can do something like:
$podcast_name = 'comedy_with_joe'; require "podcast_processors/${podcast_name}.pm"; PodcastProcessor::somesub();
where each of your podcast processor modules would look like:
# process podcasts for XYZ package PodcastProcessor; ... yadda ... sub somesub { ... }
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
---|