Advice for moving linux script to MacPerl

Discussion in 'Perl Misc' started by, Mar 9, 2005.

  1. Guest


    I work for a public school where I have written a web-based CGI program
    in perl that runs on our Linux web server. Another school would like
    to use this program as well, but they have an OS9 server with
    AppleShare IP. I have experience with Linux and Win2000/2003 but not
    with OS9. Here is what I have done so far to help them, and the
    problems I am having:

    - I told them to download and install MacPerl, which they did.

    - I then sent them a sample script to try out. It is a simple perl
    script (printev.cgi) that prints the environment variables. I changed
    the 'shebang' to fit the MacPerl syntax and used my text editor to save
    the file in Mac format (to have the proper end of line character). The
    script looks like this:

    #!perl -w

    print "Content-type: text/html\n\n";
    print "<tt>\n";
    foreach $key (sort keys(%ENV)) {
    print "$key = $ENV{$key}<p>";

    - Next I had them put the file in a web-accessible folder.

    - Then I entered the URL for the file in my browser.

    Here's where the problems started. The file did not get processed by
    perl, but rather simply displayed in code format in the browser. The
    server did not know what to do with the file, so it just displayed it
    as text.

    So here's what I did next:

    - I had their tech guy start up MacPerl on the server, then open my
    script file in MacPerl, then do a "Save As" and save the file in the
    format "CGI Script".

    - When looking at the new file it appears that MacPerl put a binary
    "wrapper" around the original text file.

    - He replaced the old script with this new file.

    - I opened the URL in my browser and perl processed the file perfectly
    this time.

    So here's my question... Is this what you have to do to get perl
    scripts to run on an OS9 server with AppleShare IP? If so then here's
    the problem: My entire program is over 100 individual scripts. Will
    their tech guy have to open each script one by one and resave in "CGI
    Script" format?

    In my experience with Linux and Win2000/2003 a perl script is always
    just a text file. There is no need for a binary wrapper to make them

    Shouldn't the "shebang" just tell the web server to give the file to
    MacPerl for processing, and allow me to send them all 100+ scripts as
    simple text files (of course with the proper Mac end of lines)?

    Thanks in advance for any help with this! I am sorry for my lack of
    Mac knowledge and look forward to being enlightened.

    , Mar 9, 2005
    1. Advertisements

  2. wrote in news:1110334853.242722.30470

    > So here's my question... Is this what you have to do to get perl
    > scripts to run on an OS9 server with AppleShare IP?

    The language in which the scripts are written is irrelevant. This is a web
    server configuration question. As such, you would be more likely to get
    useful responses on an appropriate forum. For example,


    seems like a good place to try.

    A. Sinan Unur, Mar 9, 2005
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. linkswanted
    Dec 21, 2007
  2. linkswanted
    Jan 6, 2008
  3. Newbie Q: MacPerl / CGI woes

    , Sep 8, 2003, in forum: Perl Misc
    Vlad Tepes
    Sep 8, 2003
  4. Nathan Olson

    MacPerl vs. Unix (OS X) Perl

    Nathan Olson, Jul 12, 2004, in forum: Perl Misc
    Bart Lateur
    Jul 13, 2004
  5. Xiong Changnian

    MacPerl, OS 9, move file to Trash

    Xiong Changnian, Jan 25, 2007, in forum: Perl Misc
    Xiong Changnian
    Jan 26, 2007

Share This Page