Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Running on XP I type:
perl program.pl
at the console prompt and get the following
Can't exec /c/apps/pp3.exe at download.pl line 1.
program.pl looks like this:
#!/c/apps/pp3.exe print "Hello\n";
The shebang notation is there for cygwin. pp3.exe is a c program that translates cygwin paths to windows paths before calling the real perl interpreter. So that if I run the script from bash like this:
$ program.pl /c/some/path/orother
then the right path (using windows path separators) gets through to the (activestate) perl interpreter
Which is all good, except (back to the original problem) why is perl.exe even looking at this line? As far as it's concerned it's a comment, right?

I've tried:

c:\Perl\bin\Perl.exe program.pl
and also double clicking program.pl in explorer and perl.exe seems to want to evaluate the shebang notation.

I'm sure this is not the normal perl for windows (or any platform) behaviour???

...More testing...
In fact if I set the shebang to another c program such as args.exe then it runs that instead of the perl interpreter even though perl calls the script directly

I have a bad feeling I'm missing something here...

Matt


Perl is:

perl -v This is perl, v5.8.6 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall Binary build 811 provided by ActiveState Corp. http://www.ActiveState. +com ActiveState is a division of Sophos. Built Dec 13 2004 09:52:01

20050502 Edit by ysth: change pre to code tags


In reply to Perl thinks it's the shell! by misterw

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-10-25 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?