I would like to use perl code in my config file. I am not able to make this work when using strict, warnings and declaring variables.
Can someone look at my config file and my script and tell me what I need to do to get this to work properly
Script
use warnings;
use strict;
my ($scalarone,$scalartwo,$scalarthree,$scalarfour,$scalarfive,@arrayo
+ne,@arraytwo,%hashone);
use lib("/tmp");
do "config.cfg";
print << "PRINT";
########################################
Scalarone is
$scalarone
########################################
Scalartwo is
$scalartwo
########################################
Scalarthree is
$scalarthree
########################################
Scalarfour is
$scalarfour
########################################
scalarfive is
$scalarfive
########################################
Arrayone is
@arrayone
########################################
Arraytwo is
@arraytwo
########################################
Hashone one is
$hashone{ONE}
Hashone two is
$hashone{TWO}
Hashone three is
$hashone{THREE}
Hashone four is
$hashone{FOUR}
Hashone five is
$hashone{FIVE}
########################################
PRINT
Config file
# Scalar Variables
$scalarone = "one";
$scalartwo = "two";
$scalarthree = "three";
$scalarfour = "four";
$scalarfive = "five";
# Array Variables
@arrayone = ('one', 'two', 'three', 'four', 'five');
@arraytwo = ('six', 'seven', 'eight', 'nine', 'ten');
# Hash Variables
%hashone = (
ONE => 'one',
TWO => 'two',
THREE => 'three',
FOUR => 'four',
FIVE => 'five');
Thanks for your help
I got 99 problems, but a @%$()_ ain't one.