Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Proper handling of shebang line while performing local testing?

by Corion (Patriarch)
on Sep 05, 2018 at 06:56 UTC ( #1221733=note: print w/replies, xml ) Need Help??


in reply to Proper handling of shebang line while performing local testing?

Maybe that someone was wrong.

You should have the perl (or whatever program) in the hashbang line which is used by the kernel to run the subsequent code. For shell scripts that is /bin/sh (or whatever), and for Perl scripts, that should resolve to the appropriate Perl interpreter.

Using the redirection through /usr/bin/env is en vogue with some people, but hardcoding /usr/bin/perl if that's not your Perl is just wrong.

Replies are listed 'Best First'.
Re^2: Proper handling of shebang line while performing local testing?
by nysus (Parson) on Sep 05, 2018 at 07:01 UTC

      Maybe then you need to invoke your tests in a different way. I usually run single tests as

      perl -Mlib -w t/01-api.t

      ... and the whole test suite with

      make test

      or, if I want to run the author tests as well, with:

      make prove -bl xt/ t/

      Directly starting a test will get things confused because the kernel will invoke the Perl that is hardcoded in the first line instead of using the Perl that you (may) want.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1221733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2022-05-22 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?