home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Select: Windows 95 Special 1
/
WINDOWS95_1.ISO
/
utils
/
perl32
/
perltech.txt
< prev
next >
Wrap
Text File
|
1995-06-20
|
11KB
|
318 lines
Larry Wall's Perl v4.x for NT/Win32/MSDOS
-----------------------------------------
Written By Maxwell Nairn Andrews
--------------------------------
CompuServe Mail: 100065,531
Internet Mail: maxwell@ukiis.demon.co.uk
Last Version Alpha.0 15th January 1995
--------------------------------------
Latest Version Beta.3 18th June 1995
------------------------------------
Technical Information for PERL32
--------------------------------
I assume that the reader is fluent in MSDOS, and Win95/Windows/NT, as well as
a Perl user. As this is an Beta version of PERL32, I will describe just the
basic operational usage of PERL32. PERL32 needs a 386 PC as a minimum, as well
as 4 MB of extended memory.
PERL32 Platform Setups
----------------------
General Setup
-------------
The PERL32 GUI development environment creates temp files ( see REAME.1ST ). By
default these files are created in the same directory, from where the PERL32.EXE
was executed. By setting either the TMP=, or TEMP= DOS environment variables,
these files will created there e.g SET TMP=C:\TMP. You could also create a RAM
drive, and point the TMP, or TEMP environment variables to this drive. If you use
the -b option then NO files are created ( see -b option below ). PERL32 GUI can
use a mouse, so please load your MOUSE.EXE driver before PERL32.EXE.
MSDOS Setup
-----------
Files Required: PERL32.EXE DPMI32VM.OVL 32RTM.EXE GLOB32.EXE
The above files need to be in the DOS search PATH, or in the same directory. The
32RTM.EXE is Borlands 32bit DPMI server. PERL32 locates 32RTM, and loads it. You
can execute 32RTM as a TSR e.g 32RTM -X before executing PERL32. The -X option
will save some conventional memory. Loading 32RTM as a TSR will also decrease the
PERL32 load time. By default Borlands 32bit DPMI server, allocates ALL extended
memory. By using the RTM DOS environment variable you can limit this. For example:
SET RTM=EXTMAX nnnn
means don't allocate more than nnnn KB's of extended memory. Another example:
SET RTM=EXTLEAVE nnnn
means always leave nnnn KB's of extended memory. The default is 64Kb. There are
other RTM= options but these are the important ones.
Windows/WFWG v3.1x Setup
------------------------
Files Required: PERL32.EXE GLOB32.EXE WINDPMI.386
The WINDPMI.386 driver needs to be put into your Windows SYSTEM directory. Also,
the SYSTEM.INI INI file will need to be modified. For example:
[386Enh]
device=WINDPMI.386
Windows/WFWG v3.1x with PERL32 MUST be executed in a DOS box. PERL32 is not supported
with Win32s, and threfore the DOS box will supply the DPMI server. Executing PERL32
in a DOS box should not cause any problems.
Windows NT and Windows 95 Setup
-------------------------------
Files Required: PERL32.EXE GLOB32.EXE
PERL32 uses Win32 directly so no other files are required.
PERL32 Additional Command Line Options
--------------------------------------
By default PERL32 comes up in Borlands Turbo Vision GUI. This is fine for development,
but not required for production use. PERL32 has the -b option to ignore the GUI interface.
For example:
PERL32 -b WINVER.PL
The above example will execute the WINVER.PL Perl script, but not using the GUI interface.
Please note thats a 'lower-case' b. You can use the standard Perl options as well. For
example:
PERL32 -b -w WINVER.PL
turns on Perl warnings as well. The DOS environment variables set in a Perl script, are
local to that DOS environment. For example for DOSPATH.PL:
$ENV{'PATH'}= 'C:\\DOS;C:\\PERL32';
The above Perl script will only set, the current environment PATH. By using the -B option
the MASTER DOS environment can be modified. For example:
PERL32 -B DOSPATH.PL
This will set the PATH to C:\DOS;C:\PERL32. Note that the -B option implies the -b option.
The -B option will not be activated in GUI mode. Use the -B option with caution, it has only
been tested on DOS 6.2x, and could wipe out your DOS environment. The -b, and -B options are
remove before executing the Perl code, and hence does not interfer with the standard options.
The PERL32 GUI Interface
------------------------
The PERL32 GUI is written in Borlands 32bit Turbo Vision v2.0. Although design for DOS based
applications, I have modified it so that it will work correctly in CONSOLE mode on NT, Windows
v3.1x, and Windows 95. If you have a mouse device, please load the MOUSE.EXE driver before
loading PERL32. By default PERL32 will always execute in GUI mode, unless the -b option is used.
If the reader knows how to use Microsoft Windows, then using PERL32 with a mouse should be easy.
There is only One editor window, and a clipboard. Both the editor window, and the clipboard can be
used to Compile/Run any Perl v4 script. Use the 'tile' option in the Windows Menu to display the
editor window, and clipboard together. Note that clipboard is hidden by default. The Show Clipboard
option is in the Edit Menu. Both the editor window, and the clipboard are 'Zoom'able.
The PERL32 GUI has Two TELETYPE TERMINALS, one for the standard out ( STDOUT ), and one for the
standard error ( STDERR ). These windows can be activated at any time by using the F4, and ALT-F4
function keys. These Two windows automatically become visible, when there is New output to be
displayed. These windows are TELETYPE in nature, and are always created. You can scroll back to past
output events. Note these TELETYPE windows can not be cleared, or erased. The main editor window
is what you will be using for your development Perl v4 scripts. This is a gap-buffer editor, and has
a limit of 64Kb. This means a Perl v4 script must not be over 64Kb in size. This is Borlands limit
not mine.
To Compile a Perl v4 script, you would either load an existing Perl v4 script, or create one in the
editor window/clipboard, and press F9 to Compile, and Run the Perl script. Placing the mouse pointer
over the F9 Compile/Run Menu, and pressing the left mouse button does the same. If there are any Perl
errors then the Perl STDERR will be displayed, and the Status Information window updated. The PERL32
GUI will automatically jump to the line with the error, and change the cursor into a 'block'. Whenever
the cursor is in 'block' mode, and the INSERT key is not on, then a Perl script error has occured. As
soon as the Perl script error is cleared, then the cursor will return to normal.
*NOTE*
You don't have to keep saving your Perl v4 script, in order to compile it with F9. As soon as you make
changes to the editor window, or clipboard you can compile these changes with the F9 function key.
Command Line Arguments in the GUI
---------------------------------
To change the command line arguments, use the Control-ENTER key, or go to the options Menu. You can
place additional command line arguments, to the Perl scripts in this input line box. Any original PERL32
command line arguments, are copied into the buffer on every invocation. These can be deleted, and new
command line options put in their place. There is one option that you can use here, namely a single
hyphen '-'. The single hyphen placed anywhere in the Control-ENTER input box, can be used to substitue
the name of the Perl v4 script to compile. For example if the Control-ENTER input box was:
-w - TEST.TXT
and the name of the Perl v4 script was TEST.PL, the Perl compiler would be passed:
-w TEST.PL TEST.TXT
The Control-ENTER input parameters remain active, until the next invocation of the Control-ENTER option.
PERL32 Examples
---------------
I have only supplied One example called: WINVER.PL. I have added a New Perl function called WINVER, that
returns the platform information. This example is shown below:
# Program Example for O/S Version Check
# by Maxwell N. Andrews
# Date: 12th Jan 1995
$winver= winver( );
$platform= "Unknown";
if ( $winver & 0x80000000 ) {
$platform= ( $winver & 0x40000000 ) ? "Windows 95": "Win32s";
}
else {
$platform= "Windows NT, or DPMI32";
}
printf( "You are using $platform v%d.%d\n", $winver & 0xff, ( $winver >> 8 ) & 0xff );
# End of Program
This just uses the Microsoft Windows "GetVersion" API call.
PERL32 Odds and Ends
--------------------
Bugs
----
Borlands C++ compiler v4.5 still has a few bugs lurking about. I originally hoped that this Beta version
would be ready in November 1994, but I had to wait for the v4.5 compiler. If at any time the PERL32 program
justs exits to MSDOS, then most probably you have found a bug. This is normally due to the conversion to
32bits, and the memory violations that occur.
Ommissions
----------
The standard in, or STDIN of the PERL32 GUI, is not bound to a window. This means that on keyboard input, you
can overwrite any window. This will not effect the operation of PERL32, it just looks messy.
Immediate Plans for PERL32
--------------------------
I am at present adding support for Microsoft NT/Windows 95 Registry. This version of Perl will be known
as: WINPERL. It is hoped that WINPERL can be used as a tool for setup, and maintainance of the Registry.
Whats NEW in PERL32 Beta.3
--------------------------
PERL32 Beta.3 contains various bug fixes etc.
(1. Perl 'require' open file handle problem fixed
(2. Perl 'readdir' function problem fixed
(3. Perl <<EOF problem fixed
(4. Borland C++ v4.5 Bug fixes for PERL32, and GLOB32
(5. Swapped Terminal Output/Error Output Function Keys F4, Alt-F4
(6. Included SAMPLE WINPERL.EXE Program with PL scripts
GUI WINPERL for Win32, Win32s, Windows 95, and Windows NT
---------------------------------------------------------
I have included in this Beta.3 release my WINPERL for Win32. This will
function with Windows v3.1x (with Win32s), Windows 95, and Windows NT.
I have not included any more information than this because WINPERL is
still being developed. Registry support is now functional in WINPERL,
but no documentation has been written at this present time.
I hope you find it useful.
WINPERL Known Problems
----------------------
(1. STDIO output Window will corrupt if Two Perl Windows are left opened
(2. Perl output slow due to STDIO redirection
(3. Sometimes STDIO output Window refuses to 'die'
WINPERL PL Scripts
------------------
HIVES.PL -- WINPERL 'require' PL script for Registry Access
SMTP.PL -- Sample SMTP Enable script for Internet Mail in Windows 95
LMHOSTS.PL -- Sample DNS/LMHOST Setup for Windows 95
For example, to execute SMTP.PL under Windows 95 in batch mode:
WINPERL -b SMTP.PL
Notes
-----
No TCP/IP socket support in Perl32/WINPERL