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  hermanningjaldsson at 16:20 on Saturday, February 24, 2007
 

Change the name of the perl variable.


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

or this..

eval "use $module_name";


  Re: package name is variable  hermanningjaldsson 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
• Re: store string from text file to vector
• Re: c# .net Exception of type System.StackOverflowException was thrown.
• Re: error: expression must have a constant value
• Re: Script Does Folder Exist – If Not Create It
• $_GET not working
• GET METHOD
• Re: windows service - web service - com
• Re: Storing data from HTML to Excel or TXT
• Re: Help totalReads=1 totalReads++=2 write totalReads 3 not 2


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-2010