Perl 5.6 for Windows CE
There are currently two programs for perl on wince: perl itself and
a simple editor named PerlIDE. The programs run on nearly all wince
platforms, even on WINCE200 and Palm Size PCs. There is also a build
for CEPC/X86.
News
Thu May 22 2003: Vadim Konovalov has more recent Perl
binaries available, also with Perl memory allocator,
see links below.
Sat Oct 27 2001: Win32::API and Win32::OLE have been
ported. Win32::OLE works with ADOCE.
Sat Nov 03 2001: Added profile report for those curious
why loading standard mods is so slow.
Mon Jun 17 2002: News from Tsukamoto Makio
(tsukamoto@digit.que.ne.jp http://digit.que.ne.jp)
One, PerlCE worked on XScale.
I bought GENIOe550G which has processor based on XScale.
I installed console, fileutils, PerlCE and PerlIDE.
All of them worked on GENIOe550G.
Two, CPAN module "HTTP::Lite" worked on PerlCE.
I found HTTP::Lite module on CPAN, recent updates.
I tried it on PerlCE, it worked with proxy suppoting.
It'll help us with making HTTP client on PerlCE.
Perl
The binary archives do not contain any perl library files. You
have to copy them from a regular perl distribution. There are only a
few xs dlls in the archives.
PerlIDE
PerlIDE is a simple editor for perl. You can start scripts from it
and show the output. When the cursor is positioned on a line
with an error and line-number, you can jump to that line.
Features/Limitations
Perl scripts not using pipes and external commands should
run with no problems.
Simple terminal escape sequences for stand-out and cursor positioning.
Some XS dlls supported (IO/Socket/Dumper/NDBM/SDBM).
No fork().
No threads or PerlObject.
Simple pipes should work with programs that use celib.dll.
New mods Win32::API and Win32::OLE.
Installation
Get the archive for your device and unzip on your pc.
Be sure to have smart crlf conversion turned off in WinZip.
Copy the files to your device.
Get latest celib.dll and copy to your \windows directory.
Create registry entries using the registry editor from Microsoft's
Powertoys for WinCE or using my cereg.exe. cereg.exe must run on your
PC. An ActiveSync connection must be established.
There are sample batch files in the archives.
Create a link to PerlIDE on your desktop.
Start PerlIDE and check the options dialog.
To start perl scripts by clicking on a .pl file, you have to
create one or two keys in HKEY_CLASSES_ROOT, like on normal
Win32.
You can copy other files from a standard perl dist to your device.
Be sure to use files from the same perl version.
Do not overwrite the files that come with perl for wince.
Create directory dev in your UNIXROOTDIR (see below). This will be
used for a pseudo /dev/null or nul.
For looking up service ports with getservbyname(),
you need to have a services file
in $UNIXROOTDIR/etc/services.
Registry
Below is a sample batch file that you can execute on your PC
with an ActiveSync connection established.
cereg.exe can be found
here.
set perlpath=\Storage Card\perl
set perlexe=%perlpath%\bin\perl.exe
set perllib=%perlpath%\usr\lib\perl5
::- PERL5LIB
cereg -k "HKLM\Environment" -n "PERL5LIB" -v "%perllib%"
::- For ShellExecute
cereg -k "HKCR\.pl" -n "" -v "perlfile"
cereg -k "HKCR\perlfile" -n "" -v "Perl Script"
cereg -k "HKCR\perlfile\DefaultIcon" -n "" -v "%perlexe%,-1"
cereg -k "HKCR\perlfile\Shell\open\command" -n "" -v """"%perlexe%""" ""%%1"""
::- Misc
REM Height of 10 is ok, 14 does almost full screen
cereg -k "HKLM\Environment" -n "ROWS" -v "14"
REM MAX Width for PPC is 29 Chars
cereg -k "HKLM\Environment" -n "COLS" -v "29"
cereg -k "HKLM\Environment" -n "PATH" -v "\Storage Card\bin;%perlpath%\bin"
cereg -k "HKLM\Environment" -n "UNIXROOTDIR" -v "\Storage Card"
Problems
To use the Autoloader, PERL5LIB must contain forward-slashes. I have
not yet tracked this problem.
On Casio E100 there seems to be a socket.dll in ROM.
You might have to rename the socket.dll that comes with perl and patch
XSLoader.pm to load the renamed dll.
On WINCE200 devices, perl56.dll, celib.dll and cedialogs.dll
must be copied to the
windows directory. This is not needed with other os versions, but
might be a good idea anyway.
On WINCE200 devices you need msvcrt.dll. It must be copied to your
windows directory. msvcrt.dll can be found
here.
Reading and writing to the same filehandle might not work. It should
work on raw files. This will be fixed.
Textmode, like in DOS or Win32 is not supported. All files are opened
in binary mode.
Perl code that checks if a filename is absolute by checking for drive
names will not work.
perl -v might hang on some devices.
The console window closes when perl exits. When you want so see the
output in the console window, you might have to display a short
message and ask the user to hit return, then read from STDIN
at the end of your program.
The console window might have scroll glitches when ROWS is not set
or is too large.
The environment from the registry might not be visible in $ENV. This
bug will be fixed in a new release.
cereg.exe is reported not to work with some WCE211/PalmSize devices.
Performance
Loading all the standard modules to do reasonable work is kind of
slow. I have hacked a simple profiler that uses the /Gh option and
some assembly. Here is a profile report
for Perl loading the stuff for Win32::Serial. I have no idea yet where
to start optimizing things. It would best when standard modules could
be pre-loaded and dumped into Perl like in Emacs.
Notes
All new programs using my console now have a --noconsole option. When
set, the console window does not show up.
Be sure to use the newest celib.dll and don't overwrite it with older
ones from other packages. New celib.dll builds should be
backward-compatible.
When you need a pipe and only want to read output from another
program, you can read it's standard output files from the root
directory. This only works with programs using my celib.dll.
Future
Perl 5.7 is being tested. The Windows CE port will be part of the
standard perl distribution.
Downloads
All files
Links
PerlCEDocument - Japanese Translation by Tsukamoto Makio
PerlCEInstall by Tsukamoto Makio
PerlCETest by Tsukamoto Makio
Info about building Perl 5.7.3 for WinCE by Tsukamoto Makio
perlce.sourceforge.net - New Perl builds by Vadim Konovalov
Home