in reply to Re^5: Is this DBM::Deep behavior, or something with tie/bless? (ref)
in thread Is this DBM::Deep behavior, or something with tie/bless?
So just fix Data::Compare. The fixes would probably be quite simple. The best fix is to change such things to:Wouldn't that give a useless use warning? I would suggest this instead, which also works for CODE.It is fine to use ref as a Boolean test. Any other uses of ref I simply can't recommend.if( ! eval { @$requires; 1 } ) { # Can't be used as an array refNote that the above trick doesn't work for CODE references so you have to resort to one of the second-best methods. I'd use the following:
Pre-perl 5.10, either has a problem with arrayrefs being able to be dereferenced as pseudo-hashes.if( ! eval { \@$requires } ) { # Can't be used as an array ref
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Is this DBM::Deep behavior, or something with tie/bless? (ref)
by tye (Sage) on Feb 12, 2008 at 16:50 UTC | |
by ysth (Canon) on Feb 12, 2008 at 16:59 UTC |
In Section
Seekers of Perl Wisdom