Hi Folks
I've got a small Perl program and I use the 'require' method to read in variables from an external "config.txt" file.
The variables are $fname="kenny" and $lname="ritch".
However, when I use these variables in my Perl program (with 'use strict') I get errors that I haven't inititalised the variables. If I don't use strict, the program runs fine. Since I like using strict, how do I initialise the variables so that Perl is happy?
...
use strict
require "config.txt";
print $fname; <- How do I initialise this variable?
print $lname; <- How do I initialise this variable?
...
Cheers,
Kenny.
I've got a small Perl program and I use the 'require' method to read in variables from an external "config.txt" file.
The variables are $fname="kenny" and $lname="ritch".
However, when I use these variables in my Perl program (with 'use strict') I get errors that I haven't inititalised the variables. If I don't use strict, the program runs fine. Since I like using strict, how do I initialise the variables so that Perl is happy?
...
use strict
require "config.txt";
print $fname; <- How do I initialise this variable?
print $lname; <- How do I initialise this variable?
...
Cheers,
Kenny.