Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I have two differences that are proving to be intransigent.

1) On Windows, I can set $!perl on the first line, and since perl is in the path, Windows finds it and executes the script. On linux, I have found the hard way that I have to use #!/usr/bin/perl. Otherwise, Linux refuses to execute the script. Obviously, this means I can not use a single set of files that will run on both Windows and Linux. Rather, I have to maintain two sets of files in which the ONLY difference is the #! line. Is there a way to work around this, so that identical code will run properly on both platforms; and that without taking a performance hit?

2) In my apache2 configuration, in my cgi-bin configuration, I have an AddHandler statement that associates perl-script with all files in cgi-bin with the .pl extension (and I did remember to restart apache after adding that AddHandler statement). On Windows, this was sufficent. Without it, on OpenSuse Linux, apache tells me that the file doesn't exist. But, with it, apache offers to open the file with kwrite, instead of executing it. I DID use chmod 700 to make the file executable (though I am not sure this is correct), following a couple pages I found using Google. NB: at this time, I am not using mod_perl (though that may change soon). This is on OpenSuse 12.3. What have I missed that results in the offer to open or download the script rather than having it executed?

NB: I am in the process of learning Linux after decades of working intensely on Windows, so please don't be too harsh if I missed something basic. ;-)



In reply to CGI troubles for code that runs on both Windows and OpenSuse Linux 12,3 by ted.byers

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (10)
    As of 2018-04-23 14:21 GMT
    Find Nodes?
      Voting Booth?