in reply to Re: 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?

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

  • Comment on Re: Re: Re: What type are you? Mr Hash, Sir Array, or Miss Scalar?
  • Download Code