"
This is happening because wherever you have a conditional based on a variable that may not contain a value"
Nope. Perl forgives you if you simply test or assign a bare uninitialized variable in a conditional. Your code works for this reason -- no warning for "if ($var)". Going over your post, I think this is a case where you understand but just mis-stated your assertion.
Note:
#!/usr/bin/perl -w
use strict;
my $stuff;
# No complaint here
if ($stuff) {
print "hello\n";
}
# No complaint here
if (my $stuff2 = $stuff) {
print "hello\n";
}
# But this interpolation causes a warning
if (my $stuff3 = "$stuff") {
print "hello\n";
}
# This concatenation complains also
if (my $newstuff = "new $stuff") {
print "hello\n";
}
------------------------------------------------------------
"Perl is a mess
and that's good because the
problem space is also a mess." - Larry Wall