in reply to module location
"use" happens at compile time, but the $perl_module variable isn't initialized until run time, after the "use" statement has already executed. Actually you can't use a variable package name, but you can require it. Try this:
Alan#!/usr/bin/perl -w use strict; my $perl_module = shift; eval {require $perl_module} or die "Can't find $perl_module!";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: module location
by hmerrill (Friar) on Nov 07, 2003 at 15:34 UTC | |
by ferrency (Deacon) on Nov 07, 2003 at 19:07 UTC |
In Section
Seekers of Perl Wisdom