Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

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: (11)
As of 2016-10-27 14:17 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (364 votes). Check out past polls.