develooper Front page | perl.perl5.porters | Postings from October 2009

Re: [perl #70043] Re: [Sysadmins] Perl allows non-sensical operations on reference converted to an integer

Thread Previous | Thread Next
From:
David Golden
Date:
October 27, 2009 04:27
Subject:
Re: [perl #70043] Re: [Sysadmins] Perl allows non-sensical operations on reference converted to an integer
Message ID:
5d4beb40910270427r53c2b4ecq6f1d463b3686ccd7@mail.gmail.com
On Tue, Oct 27, 2009 at 7:21 AM, Abigail <abigail@abigail.be> wrote:
> I use often stringified references. Either by printing them (debugging
> tool), or as hash keys. If I want a quick and dirty implementation
> of inside out objects and I'm using a pre-5.10 perl, I use objects
> as keys keys directly.
>
> Forbidding anything that may lead to an error somewhere else in the
> code would quickly leave us with no construct in the language at all.

Fortunately, you'd still be able to do so in pre-5.10 perl.  :-)

Making reference stringification a warning wouldn't stop quick and
dirty debugging, which is why I say that would, at a minimum, be an
improvement on the current situation.

I might be in favor of refaddr() moving into core from Scalar::Util so
it's always available even if module loading is borked.

-- David

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