develooper Front page | perl.perl5.porters | Postings from March 2017

Re: The tricky issue of do()

Thread Previous | Thread Next
From:
Sawyer X
Date:
March 30, 2017 08:46
Subject:
Re: The tricky issue of do()
Message ID:
558027ea-0be9-3353-3e1d-4bb4e9d72200@gmail.com


On 03/30/2017 09:26 AM, Dave Mitchell wrote:
> On Wed, Mar 29, 2017 at 09:52:20PM +0000, Matt S Trout wrote:
>> On Wed, Mar 29, 2017 at 12:38:29PM +0100, Dave Mitchell wrote:
>>> Does the following change to the 'do' entry in perlfunc look plausible to
>>> cope withe the facts that:
>>>     * dot is now removed from @INC by default;
>>>     * do now warns;
>> I would also make sure that the example uses ./
> Well, the first example within the '=item do EXPR' section is
>
>     do './stat.pl';
>
> Is that what you meant?
>
>> and instead of just
>>
>>   do "stat.pl" failed, '.' is no longer in @INC
>>
>> the warning should be
>>
>>   do "stat.pl" failed, '.' is no longer in @INC, did you mean do "./stat.pl" ?
>>
>> ala the "did you need to install" error on require() failure.
> I'd be reluctant to change the warning at this extremely late stage.
> Although if (as indicated in another thread) we need to fix up a whole
> load of code within the perl distribution that does 'do' anyway, then
> perhaps it not to late.  Anyone else have an opinion?

I'm not *too* worried about changing the warning again, since the
previous warning message was just one dev release ago. I think this is a
useful warning and I'm sorry I didn't figure it out when Tony asked me
how it should look like. D'oh.

It would definitely save a lot of headache and it's just a string
change. (Famous last words.)

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