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

Re: [MacPerl] How Cross Platform is Perl



Tom Schruefer, <tschruefer@mail.howard.k12.md.us> wrote:

> Will all the versions of Perl for various Platforms UNIX, Mac, Win32, 
> etc..  I find myself wondering just how cross platform compatible Perl 
> is.  

The simple answer is suprisingly so.

> For instance, replacing the interface code, could one run the same basic 
> Perl program on all the supported platforms?  

Actually, there are ways (tricky ways, but ways nonetheless) to write the 
interface code such that a single program, interface and all will be 
supported by all platforms.  Perl can do a conditional test for what OS 
it's running on, and a knowledgealbe programmer can make his code adapt 
the interface on the fly depending on the OS.,  I'm not saying that 
anyone's actually done this, but it should be possible to write each 
interface as a seperate package, and call the packages from within a 
conditional test for $^O.

Practically, one must know how to write interface code for every OS one 
plans to deploy on.  This can be Perl/tk for Unix, the Mac Toolbox for 
our favorite GUI, and whatever is available under Win32 Perl (not even 
sure myself, might be able to get way with Perl/tk).

> Is it possible to build Perl executables for a Win95 or WinNT system, 
> like can be done for the Mac?  

The simple answer to this is no.  However, the REASON for executables 
(runtime interpreters actually) in MacPerl is to make up for both some 
missing functionality, and the lack of ubiquity of full installations of 
Perl on the Mac.  This missing functionality is that (under Unix) any 
process (including Perl itself) may invoke Perl.  Thus under Unix, every 
Perl script *can behave* like a stand-alone app.  Not so sure about NT.

> Could the same core code be run as a CGI  on a UNIX system, using HTML for
> its interface?

Properly written, the same core code could be run as a CGI under ANY OS, 
but unless you really need it to run as a CGI, see my answer about 
interface code.  I think the CGI route is very much a sub-optimal 
solution.

> Just a few questions.

Which I hope I've been able to answer, thanks!

--B

# Fungal Parataxonomy                   Mycology Information (Mycoinfo)
# Webmaster, Staff Writer      **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/> 
#
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org