develooper Front page | perl.perl5.porters | Postings from May 2018

Re: [perl #133202] squaring a reference doesn't cause an error

Thread Previous | Thread Next
Diab Jerius
May 16, 2018 14:42
Re: [perl #133202] squaring a reference doesn't cause an error
Message ID:
On Tue, May 15, 2018 at 6:58 PM, Dan Book via RT
<> wrote:
> On Tue, 15 May 2018 15:42:34 -0700, wrote:
>> It might be useful to have this as a warning if it isn't already.  I'd
>> imagine that this isn't the expected result for most people.
> Probably reasonable to warn if any mathematical operation other than 0+ is done on a reference without overloads, if possible.
> -Dan

That would be very helpful.  This occurred in the middle of a rather
hairy equation that wasn't producing an expected result.  It wasn't
easy to spot the missed dereference.  Luckily the result was way off,
so it was obvious something was wrong, but I can imagine situations
where this could introduce some subtle but significant errors.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About