in reply to Making working cross-platform scripts?

Some code, some error messages, maybe some versions and such, you gotta give us something to work with.

~~
naChoZ

  • Comment on Re: Making working cross-platform scripts?

Replies are listed 'Best First'.
Re: Re: Making working cross-platform scripts?
by stonecolddevin (Parson) on Jul 03, 2003 at 02:45 UTC
    Here ya go:
    my code is on my pad, and here is the error message for this specific script:

    (2)No such file or directory: exec of /home/dhoss/public_html/cgi-bin/ +book/index.cgi failed 4279 [Wed Jul 2 22:36:47 2003] [error] [client 172.156.151.219] Pr +emature end of script headers: /home/dhoss/public_html/cgi-bin/book/i +ndex.cgi


    Ergo!!! Vis a Vis!!! Concordidly!!! Mr. Timberlake. I apologize. I don't usually like to use my big voice.
    Will Ferrill as the Architect from the Matrix 2:Reloaded
      I had a problem that was causing perl to throw error messages like that a while back when transfering perl scripts from winME to my freesco linux router. After pulling my hair out for a bit I realized that I was transfering them as text instead of binary. When I transfered them using binary (using ftp) everything worked fine.

      HTH
      Daeve

        Hmmm....to me this is counter-intuitive. ftp in ASCII mode (among other things I'm sure) translates line endings to the local notion of line ending. As such, an ASCII transfer should be more portable when dealing with something like a perl script. That is, unless you've got some compiled components, but I'd expect those to not work at all.

        thor

      To ask the obvious: Is the script executable? (did you e.g. chmod +x script.pl?). And is the path to perl in the first line correct?, the message 'no such file or directory' is issued if the shell can't find the executable it's told to feed the script to.

      regards,
      tomte


      Hlade's Law:

      If you have a difficult task, give it to a lazy person --
      they will find an easier way to do it.

        It's chmod'd correctly (775), and I've checked the path to perl, and it's correct as well...I suppose I could still try the binary mode...

        Ergo!!! Vis a Vis!!! Concordidly!!! Mr. Timberlake. I apologize. I don't usually like to use my big voice.
        Will Ferrill as the Architect from the Matrix 2:Reloaded
        to follow up on that - one elephant trap in the w32<=>unix conversion is first line:
        #!/usr/bin/perl
        If you've written that with a windows editor that line will probably be:
        #!/usr/bin/perl<carriage return>
        so the system looks for the file "/usr/bin/perl".chr(13) and doesn't find it. If you're ftping the files make sure you transferred the scripts as ascii files. Run a  tr -d \\015 <filename.bad > filename.good for good measure