Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Passing a ref to warn doesn't append file and line

Newsgroups: perl.perl5.porters
Path: g2news1.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!nntp.develooper.com!nntp.perl.org
Return-Path: <zef...@fysh.org>
Mailing-List: contact perl5-porters-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl5-port...@perl.org
Received: (qmail 2413 invoked from network); 23 Aug 2010 22:12:16 -0000
Received: from x1.develooper.com (207.171.7.70)
  by x6.develooper.com with SMTP; 23 Aug 2010 22:12:16 -0000
Received: (qmail 28356 invoked by uid 225); 23 Aug 2010 22:12:16 -0000
Delivered-To: perl5-port...@perl.org
Received: (qmail 28350 invoked by alias); 23 Aug 2010 22:12:15 -0000
X-Spam-Status: No, hits=-0.0 required=8.0
	tests=T_RP_MATCHES_RCVD
X-Spam-Check-By: la.mx.develooper.com
Received: from lake.fysh.org (HELO lake.fysh.org) (81.94.195.195)
    by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 23 Aug 2010 15:12:14 -0700
Received: from zefram by lake.fysh.org with local (Exim 4.69 #1 (Debian))
	id 1OnfFM-0002qt-CT; Mon, 23 Aug 2010 23:12:04 +0100
Date: Mon, 23 Aug 2010 23:12:04 +0100
To: perl5-port...@perl.org
Subject: Re: [perl #77384] Passing a ref to warn doesn't append file and
	line
Message-ID: <20100823221204.GE5243@lake.fysh.org>
References: <RT-Ticket-77384@perl.org> <20100823181152.GA35008@osiris.mauzo.dyndns.org> <rt-3.6.HEAD-5116-1282587141-1961.77384-75-0@perl.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <rt-3.6.HEAD-5116-1282587141-1961.77384-75-0@perl.org>
Approved: n...@nntp.perl.org
From: zef...@fysh.org (Zefram)

Ben Morrow wrote:
>Passing a ref to warn no longer adds file and line in blead:

It's up to the ref to stringify itself in a suitable manner for use
as a warning message.  Anything that can't do this (including refs to
unblessed objects) shouldn't be used as a warning.  You are, of course,
free to explicitly stringify a ref, if you actually want to use the
default stringification as a warning.

Note that the same issue already existed for die:

$ perl5.10.0 -lwe 'die []'; echo foo
ARRAY(0x817f880)foo
$

-zefram