Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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. ;-)

Thanks

Ted


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

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (3)
    As of 2014-08-31 08:19 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (294 votes), past polls