REXX embodies a different mindset than Perl. As someone who has transitioned from REXX to Perl, there are a couple of things in REXX that I miss in Perl. Eg. multi-line comments (/* */, default variable values (assign to the stem name in REXX), optional command end characters (";" is required only to separate multiple commands on a single line) and there's probably a few others that are mainly syntatic sugar.
REXX has only two variable types: simple and compound. Simple is the familiar name/value pair. Compound is like a Perl hash, it is a name followed by a period followed by an index. Eg. foo.bar "foo" is the stem name and "bar" is the index. bar may be a simple variable, and if it is, its value will be used as the index. If it isn't, its default value will be used, which is "BAR". The default value of any variable is its name in upper case. Arrays, are implemented as stem variables and indexed from 1. 0 by convention contains the number of elements in the array. Note these aren't "real" arrays in the traditional data structures sense. The array indexes are really stem indexes. A very useful trick is to give a default value to a stem by assigning to the stem name like this:
uncle. = 'Bob'
This way any indexes for the stem uncle.
that don't have a matching value will return 'Bob'. Perl has
use strict;
to tighten up the parsing rules. REXX has Signal on Syntax; Signal on Error; Signal on NoValue
(note the last semicolon is missing, and not required.) These enable control to be transfered to the subroutines syntax
, error
and novalue
respectively, where the signal condition can be examined and handled or reported as appropriate. Ah, did I mention that REXX keywords are case insensitive? REXX does not have regular expression handling. Instead string searching is handled by the
parse
statement via templates. REXX's approach is easier for novices to handle, but Perl's regular expression handling is far superior in what can be accomplished.I could go on, and if you have any specific questions I'll be happy to answer them as best I can.
ps. Larry Wall has some interesting comments on REXX and Perl [link|http://www.cs.nmsu.edu/~jeffery/godiva/semi.html|here].