http://www.fmi.uni-passau.de/archive/doc/unix/perl/faq/1.25.html (Einblicke ins Internet, 10/1995)
What is perl4? What is perl5?
What is perl4? What is perl5?
The answer to what is perl4 is nearly anything you might otherwise
program in shell or C. The answer to what is perl5 is basically
Perl: the Next Generation. In fact, it's essentially a complete
rewrite of perl from the bottom up, and back again. It's available
in alpha form (alpha-2 now, alpha-3 soon). The only docs for this stuff
is what you're about to read, and what's in the t/op/ref.t file.
Here are the things which are already done:
a faster, tighter, more flexible interpreter
new token "=>" as synonym for ","; this makes
tables look nicer
%T = ( OC => $red,
TOF => "\f",
);
and provides for named argument passing:
&some_func( OC => $red, TOF => "\f");
recursive lists and tables:
[a, b, [c, d], e] has 4 elts, the 3rd being itself a list
$r->[3]->{PEANUT}; $r is a reference to a list
of references to tables
typed pointers (references) and generalized indirection:
like @{$aptr} or &{$fptr} or &{ $table[$index] . "func" }().
merging of list operator and function calling syntax:
split /pat/, $string;
the ref operator to find out what something is a reference to
object oriented programming:
$o->func(); # call the func member function of whatever class $o is
inheritance of object types through the @ISA array
much improved -w checking
lexical scoping with the my operator
safe global variables through package statements
forces variable declarations, but only if you want it
per-package END functions triggered at die() or exit()
embeddable Perl code in C code: cc prog.c -lperl
oo syntactic extensions:
$dog->give($bone);
is like
give $dog $bone;
and
$STDOUT->flush(1);
is like
flush $STDOUT 1;
multiple co-resident perl interpreters:
Here is what is hoped to be done for production, but might not:
very easy GUI Perl applications using high-level X bindings ("guiperl")
subroutines without &'s: myfunc($arg);
mnemonic aliases for $<punctuation> variables
file handle objects: $STDOUT->flush(1);
cleanup (namespace pollution) and documentation
(eg. man 3pl getopt) of libraries
addition of several new libraries (atexit, autoload, etc.)
update h2ph and c2ph
misc perl development tools
a perl profiler
POSIX compatibility
Here is what is hope to eventually be done but very probably not in
the first production release:
generalization of dbm binding for assoc arrays to handle
any generic fetch/store/open/close/flush package.
(thus allowing both dbm and gdbm at once)
dynamic loading of C libraries for systems that can
byte-compiled code for speed and maybe security
And here are the things that will no longer work that used to:
open FILE || die;
$c = shift @a + 1;
It's tempting to want this stuff soon, since the sooner it comes
out the sooner we can all build really cool applications. But the
longer Larry works on it, the more items from this list will actually
get done, and the more robust the release will be. So let's not
ask him about it too often. Larry says (slightly edited):
I've put a tar of my current Perl 5 directory onto
ftp.netlabs.com, in pub/outgoing/perl5.0/perl5a2.tar.Z.
Now's your chance to check out all the bugs I said I fixed in
Perl 5. :-)
Before you get all twitterpated, this is unsupported "alpha 2"
code. There is no Configure, only a makefile. It will
probably only work on a Sun4. The compiler and interpreter are
still very much unoptimized (though it already runs as fast or
faster than Perl 4). It doesn't do everything that I want it
to yet. It doesn't have "my" yet (though it's got the innards
for it). It doesn't have a debugger.
Like the Alpha 1 prerelease, this is an unsupported code. It is
expected to work only on a Sparc architecture machine. No
Configure support is provided. In fact, if you succeed in
configuring and making a new makefile, you'll probably overwrite
the only makefile that works. (Note that a Sparc executable comes
with the kit, so you may not need to compile at all.) There is
no list of new features yet, but if you look at t/op/ref.t
you'll see some of them in use. perl -Dxst is also fun.
But it does have references, and you can play with them. The
object oriented stuff is there too. See the op/ref.t file for
how to use them.
I smell some new JAPHs coming...
I don't want to get stuck "supporting" this, but if you want to
run your favorite scripts past it and see which ones toss their
salad, you may. If you can come up with a decent bug report
with a small test case, I'll certainly be glad to look at it.
I'm not really interested in obscure core dumps at the moment.
I'm still getting plenty of those on my own.
I'm not yet interested in memory leak reports either.
I can tell you that no program that uses the old autoloading
mechanism will run, since there is no visibility into the
symbol table pointers currently. You ought to be able to
redefine a subroutine while it's running, though. (I haven't
tested that in several months, however. There oughta be a
regression test for that...)
Don't bother trying to diff Perl 4 with Perl 5. Everything is
different. All names have been regularized. Here's a key, if
you're brave and want to peek at the sources:
SV scalar value
AV array value
HV hash value
GV glob value
CV code value
RV reference value
PV pointer value
NV numeric value
IV integer value