|The stupid question is the question not asked|
Uninitialized value in string warnings (was: Warnings:)by Anonymous Monk
|on Jun 08, 2002 at 01:06 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
Is there an easy way to lookup the causes and possible solutions to the use warnings messages?
The particular one I am getting is: warning: Use of uninitialized value in string at script.pl line 14.
14:my $c = "$a$b";
At this point, $b may or may not contain anything - if its does, it want it if not that's ok too.
I tried my c$ = "$a$b" if ($b); but that means c$ doesn't get defined if b$ has no value. So then I have to move to my c$ = ($b) ? "$a$b" : "$a"; but that seems a bit hookey to prevent a warning about something I knew would be true and didn't mind?
Is there a better way of avoding the warning?
Edit kudra, 2002-06-08 Changed title