[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] web cgi question



>Thanks for all the help, folks!  I think I understand how to trade MAC
>scripts with UNIX people now -
>1. save a perl script as plain text
>2. start the script with #!/path/to/perl/program/
>3. make sure the script contains no 'mac specific' calls in it
>
>and then it should run on any UNIX machine that is running Perl?

Pretty much. If you work with files, you need to make your filesystem
characters platform independent, sorta. Macs use ":" between folders, and
a volume begins with the volume name. Unix uses "/" between folders, and
a volume begins with a slash.

#Unix:
$FileSep = "/"; 
$VolumeStart = "/"; 
$RelativeStart = "";

#Mac:
$FileSep = ":";
$VolumeStart = "";
$RelativeStart = ":";

I'm not familiar with DOS/Windows, but I'd guess:
$FileSep = "\";
$VolumeStart = "C:\";
$RelativeStart = "";

Then make sure you don't use "/" or ":" to separate files. Use the
appropriate variable.

Jerry
jerry@acusd.edu (Finger or Reply for PGP Public Key)
http://nspace.cts.com/             finger or e-mail help@nspace.cts.com
------
"Evidence of predisposition to do what once was lawful is not, by 
itself, sufficient to show predisposition to do what is now illegal, 
for there is a common understanding that most people obey the law even
when they disapprove of it."
           -- Justice White, delivering the opinion of the court
              Keith Jacobsen v. United States,