Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Annoying warnings...

by gam3 (Curate)
on Jul 16, 2005 at 00:02 UTC ( #475390=note: print w/replies, xml ) Need Help??


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";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://475390]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2021-02-28 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?