
perlFun
User
Jun 19, 2013, 10:51 AM
Post #3 of 12
(2762 views)
|
Re: [Laurent_R] "exists" if you just have hash reference?
[In reply to]
|
Can't Post
|
|
Sorry I think I asked the question wrong. I understand that my %hashRef = stupid_sub() is incorrect. I was just saying, if I write that line of code, perl says it compiles correctly, so my assumption is that the reason I'm getting the original error is because it won't let me use exists on a reference to a hash. I was wondering how I could condense the following code: my $hashRef = stupid_sub(); my %myHash = %$hashRef; in to one line, as in, can I kind of automatically dereference the hash reference I'm getting? Or alternatively, how could I use "exists" on a hash reference? Can I dereference it inline? (as in, I want to use exists (somehow dereference $hashRef to get the actual hash){$key}
(This post was edited by perlFun on Jun 19, 2013, 10:53 AM)
|