Hi,

Just a quick question. Is it possible to have a bunch of variables in a separate file and then require that file in the script file? Let me give you and example.
----------------------------------------------------------
Script file
----------------------------------------------------------


#!/usr/local/bin/perl -w
use strict;
require variables.conf

print "Content-type: text/html\n\n";
foreach (@list) {
print;
}

exit;

---------------------------------------------------------
variables.conf
---------------------------------------------------------

my @list;

$list[0] = '1';
$list[1] = '2';
$list[2] = '3';
$list[3] = '4';
$list[4] = '5';

1;
---------------------------------------------------------
When I try the above script, I get an error - "Global variable @list needs to be defined". What am I doing wrong, or is this even possible?


Thanks,

Mark



Reply via email to