codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  package name is variable  jambabe at 14:13 on Thursday, November 02, 2006
 

Hi,

I'd like to include a Perl package in my Perl script using the 'use' stmt. However, the name of the package to be included is in a Perl variable. Is there a way to do this:

use $myPkgName;

thanks


  Re: package name is variable  mimir at 16:20 on Saturday, February 24, 2007
 

Change the name of the perl variable.


  Re: package name is variable  mimir at 14:40 on Wednesday, August 29, 2007
 

or this..

eval "use $module_name";


  Re: package name is variable  mimir at 14:58 on Wednesday, August 29, 2007
 

#here you can fill @modules with a bunch of module names and they will all be loaded in code.
@modules = ("Arrays");
foreach(@modules) {eval "use $_";}








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Date script issues
•  perl script help needed
•  onChange issue
•  perl remote execution
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007