Hi all,

I'm writing a number of small apps that will all need the same config file, 
so  using RT2 as a basis as that already uses it, I've created the following 
RWConfig.pm, and ProcStock4 which is trying to use it.

The only drawback I've seen so far is that I have to include the 'use vars' 
line before the variables are available.

Question 1: Why do I need the 'use vars', except to stop the variable used 
once message, and why does this actually make the variables available.

Question 2: What do I need to do to get away without it? As the variable list 
increases this line would get very long.

__/home/httpd/bin/RWConfig.pm__
# config file for Version 4 Progstock/genstock

# list of all dealers to be processed
%dealers=('01'=>{'letter'=>'L','dir'=>'Leeds','name'=>'Leeds'},
          '02'=>{'letter'=>'D','dir'=>'Donc','name'=>'Doncaster'});

# ISP's ftp site details
$ftpsite='theirftpsite';
$ftpuser='myuser';
$ftppasswd='mypassword;
$ftppath='~/docs';

#local cars html and jpeg dir
$localcars='/home/httpd/html/cars/';

# remote cars html and jpeg dir (under $ftppath)
$remotecars='cars';

1;
__END__

__/home/httpd/bin/prockstock4__
#!/usr/bin/perl -w 

use strict;
# want to do away with this line
use vars qw($test %dealers $ftpsite $ftpuser $ftppasswd $ftp);

use lib '/home/httpd/bin/'; # add ~/bin to incude list
use RWConfig;               # read in config

print "test='$test'\n";
print "01 letter='$dealers{'01'}{'letter'}'\n";
__END__
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to