Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: Thorny design problem

by mpeters (Chaplain)
on Sep 07, 2005 at 21:40 UTC ( #490007=note: print w/ replies, xml ) Need Help??

in reply to Re: Thorny design problem
in thread Thorny design problem

No, this won't actually work. From perldoc:

But if you try this:
$class = ’Foo::Bar’; require $class; # $class is not a bareword #or require "Foo::Bar"; # not a bareword because of the ""
The require function will look for the "Foo::Bar" file in the @INC array and will complain about not finding "Foo::Bar" there. In this case you can do:
eval "require $class";
But you could do:
my $module = 'Crunch/' . $company .'.pm'; require $module;

-- More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier

Comment on Re^2: Thorny design problem
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://490007]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-11-26 08:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls