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
From:
Diab Jerius
Date:
May 16, 2018 14:42
Subject:
Re: [perl #133202] squaring a reference doesn't cause an error
Message ID:
CADpyd5AVa3CQLGEyt1sz6JngjqBHf7ejr1HEnMiB8nEfRWd7OQ@mail.gmail.com
On Tue, May 15, 2018 at 6:58 PM, Dan Book via RT
<perlbug-followup@perl.org> wrote:
> On Tue, 15 May 2018 15:42:34 -0700, simcop2387@simcop2387.info 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About