in reply to Annoying warnings...

I think that the problem is at the point that $x is set and not at the reftype test. So you might try defining $x when it is created or set.
my $x = $y || '';
or you can set it before the test.
$x ||= '';
Or put the test in an if.
if (defined $x) { reftype $x eq 'HASH' }
-- gam3
A picture is worth a thousand words, but takes 200K.

Replies are listed 'Best First'.
Re^2: Annoying warnings...
by Mr. Muskrat (Canon) on Jul 16, 2005 at 00:35 UTC
    print '$x is ', (defined $x && reftype $x eq 'HASH') ? '' : 'not', ' a hashref', "\n";