Ben Eagle wrote:
> Thanks, I think I will go the route of making a module "Config.pm"
> 
> Although it seems there are many ways to do that, which one is the best
> or "proper way" of making one, I don't want to start coding any more
> sloppy then I already do. 
> 
> I have tried to make a config.pm module but still have troubles getting
> it to work, I am not sure why it won't find the module,  use lib "lib/";
> use Dell::Config doesn't get me to my lib directory where I have the
> folder "Dell" and Config.pm inside of that. 

What are the full paths to these directories ?
Unless your Dell dir is under the installed .../perl/site/lib or '.'
dir, you'll need a full path to it.

> Not exactly sure what I am doing wrong but strict seems to not like it
> 
> Config.pm
> ___________
> use strict;
> package Dell::Config;
> 
> our($Template, $ChartImageName, $bubbleName, $imageType);
> 
> 
> $Template = qq(Dell_Deployment_Optimization_Report.pdf);
> $ChartImageName = "DellDOChart";
> $bubbleName = "Bubble";
> $imageType =".png";
> 
> 1; #Return True
> 
> 
> BuildReport.pl
> ______________
> 
> use strict;
> use warnings;
> use lib "lib/";

The above line is wanted/needed.

> use Dell::Config
> 
> 
> code here....
> 
> 
> any ideas what I am doing wrong?

Are you getting an error of some sort ?  What indication do you
have that something is wrong ?

Assuming you have a dir Dell under the current dir or under the
site/lib dir, this should work :

use strict;
use warnings;
use Dell::Config;
print "template=$Dell::Config::Template\n";

One of the problems with doing a config file like this is
handling the scoping issues.  You could also do something like:

Dell/Config.pm:

use strict;
package main;   # put the vrbls under main

use vars qw($Template $ChartImageName $bubbleName $imageType);

$Template = qq(Dell_Deployment_Optimization_Report.pdf);
$ChartImageName = "DellDOChart";
$bubbleName = "Bubble";
$imageType =".png";

1;

__END__

use strict;
use warnings;
use Dell::Config;
print "template=$Template\n";

__END__
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to