[perlfilter] Is it possible to 'use' a perl module whose name is stored in a variable?
March 11, 2005 3:06 PM   Subscribe

Example: ------------ my $include_file_name = 'include.pm'; use $include_file_name;
posted by bryanzera to Computers & Internet (5 answers total)
 
Response by poster: Mods: Please delete my stupidity.
posted by bryanzera at 3:07 PM on March 11, 2005


(Number 4?)
posted by nobody at 3:17 PM on March 11, 2005


Anyway, the answer is to use eval { }.
posted by felix at 3:26 PM on March 11, 2005


Or require, if you don't need the side-effects of use.
posted by thebabelfish at 3:30 PM on March 11, 2005


If you do need the side-effects of use, use require $Module; import $Module;. See man perlmod for how use and require work.
posted by fvw at 7:27 PM on March 11, 2005


« Older Torrent Filter   |   Instant-On Laptops? Newer »
This thread is closed to new comments.