in reply to Re: What type are you? Mr Hash, Sir Array, or Miss Scalar?
in thread What type are you? Mr Hash, Sir Array, or Miss Scalar?

defined() bla,bla,bla? yeah, right!
Just a silly joke. Never seriously thought about that (harhar)
But i've tried the ref, and it works just fine...problem solved
  • Comment on Re: Re: What type are you? Mr Hash, Sir Array, or Miss Scalar?

Replies are listed 'Best First'.
Re: Re: Re: What type are you? Mr Hash, Sir Array, or Miss Scalar?
by Grygonos (Chaplain) on May 12, 2004 at 16:39 UTC

    ref is correct, however you can do it yourself if you want to .. (don't know why you would) you can

    my %test = ('test1'=>'value', 'test2'=>'value'); my $hash_ref = \%test; print "hash ref" if($hash_ref =~ m{HASH});
    I used that once(before I knew about ref). I don't know if that's horribly bad practice or not, but it works. So basically you could go to the trouble (again I don't know why you would want to) of setting up your own ref via a case statement of regex's