cfreak has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -T use strict; use lib '.'; use CGI; my $cgi = new CGI; my $plugin = $cgi->param('p'); if($plugin =~ /^([A-Za-z0-9_]+)$/) { $plugin = $1; } else { die "Bad plugin name"; } require Plugins::$plugin; # ...
my $req = "Plugins::$plugin"; require $req;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Variables in require
by impossiblerobot (Deacon) on Dec 04, 2001 at 23:43 UTC | |
by tilly (Archbishop) on Dec 04, 2001 at 23:51 UTC | |
|
Re: Variables in require
by broquaint (Abbot) on Dec 04, 2001 at 23:39 UTC | |
|
Re (tilly) 1: Variables in require
by tilly (Archbishop) on Dec 04, 2001 at 23:40 UTC | |
|
Re: Variables in require
by belg4mit (Prior) on Dec 05, 2001 at 00:04 UTC |