develooper Front page | perl.qa | Postings from November 2011

Re: TAP - Test::More - fork

Thread Previous | Thread Next
From:
Buddy Burden
Date:
November 15, 2011 01:01
Subject:
Re: TAP - Test::More - fork
Message ID:
CAL0mxoQxWq9-o0RRGp55E4_25jpYbJ5O8RF7hJPUnNk7a3rgfQ@mail.gmail.com
Schwern,

On Thu, Nov 10, 2011 at 5:57 PM, Michael G Schwern <schwern@pobox.com> wrote:
> On 2011.11.10 4:59 PM, Buddy Burden wrote:
>> Does that do anything?  I didn't think prove respected the shebang
>> line.  Anyway, I thought the -w to prove would be effectively doing
>> that all along.
>
> Perl respects the *options* on the #! line, prove only adds to them.

I did not know this ... just to be super-clear, obviously I know that
if I have script.pl and it starts with

    #! /usr/bin/perl -w

and I make it executable and run it directly, I get perl -w.  But
you're saying that even if I type:

    perl script.pl

I _still_ get perl -w?  That, I was not aware of.

> Adding -w to the #! line on your tests is a very good idea to avoid the
> gotcha of differences between a test being run with `prove` (does not set
> -w), ...

Well, yes, prove doesn't _normally_ set -w, but if you run prove -w,
it does, doesn't it?


            -- Buddy

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