N
Nigel
Hi there,
I'm by no means a newbie, but I've obviously missed something very
basic in my learning of Perl (entirely self-taught). I have a problem
with a web-based database I've written using Perl. The apache
error_log grows at the rate of several hundred Mb per day! I've looked
at the log contents and most of the messages refer to the use of
uninitialized values - for example in concatenations of strings.
I have three questions:
1. Do I understand from this that in Perl every variable should be
initialised - not simply defined - before it is referenced? I use
strict and all my varaibles are defined thus:
my $foo;
Should I be doing this instead:
my $foo = "";
2. Given that I've already written over seventy programs, many of
which are many thousands of lines long, is there a safe way of
stopping the error log filling up in this way...without going back and
making major changes to all my programs?
3. My programs are working fine or at least doing what I would expect
them to do. So is there actually a problem in refering to
uninitialized variables - other than the one I am specifically asking
about?
Many thanks in advance for your advice/comments (hopefully none too
rude!)
Nigel
I'm by no means a newbie, but I've obviously missed something very
basic in my learning of Perl (entirely self-taught). I have a problem
with a web-based database I've written using Perl. The apache
error_log grows at the rate of several hundred Mb per day! I've looked
at the log contents and most of the messages refer to the use of
uninitialized values - for example in concatenations of strings.
I have three questions:
1. Do I understand from this that in Perl every variable should be
initialised - not simply defined - before it is referenced? I use
strict and all my varaibles are defined thus:
my $foo;
Should I be doing this instead:
my $foo = "";
2. Given that I've already written over seventy programs, many of
which are many thousands of lines long, is there a safe way of
stopping the error log filling up in this way...without going back and
making major changes to all my programs?
3. My programs are working fine or at least doing what I would expect
them to do. So is there actually a problem in refering to
uninitialized variables - other than the one I am specifically asking
about?
Many thanks in advance for your advice/comments (hopefully none too
rude!)
Nigel