Also sprach (e-mail address removed) opalinski from opalpaweb:
page x, preface, "Programming Perl, 2nd edition", (dated stuff, yes,
part of the point coming):
"The hitherto well-kept secret is now out: Perl is no longer just for
text processing."
You thought Perl was for more than text processing in 1996. The "no
longer" implies there was a time before then when you thought it was
"just for text processing".
There were times when Perl was mostly used and useful for
text-processing. These things changed with the release of perl5.000
which happened in late 1994. It took another few years until perl5 was
more widely in use than perl4. Had perl5 in fact been perl1, this
tight association of text-processing with Perl might never have happened
to such an extent.
Let's compare what percentage of Java programs use regular expressions
and what percentage of Perl programs use regular expressions. By the
java code I've got available I see less than 1% of Java sources using
regular expressions. I'm having a hard time thinking of a grep to
identify which perl code uses regular expressions. Let's approach this
a little more intuitively:
Say you wrote a program to categorize newsgroup posts and had yourself
features for each newsgroup post. If for a particular message a
"regular expression" feature was present that would be more strongly
correlated with a perl newsgroup than a java newsgroup. Same for a
"text processing" feature.
As you've said yourself a little later: Things spread slowly. Java
didn't have regular expressions as powerful as Perl's until 1.5 whereas
Perl had regular expressions right from the beginning. The availability
of certain features and the way they are integrated into a language have
an educational effect on its user base and influence their way of
thinking. Perl programmers are used to be thinking in terms of regular
expressions, sometimes even when the problem at hand is not related to
text-processing at all: A very infamous Perl hacker devised a technique
to use regular expressions for testing if a given number is a prime
number.
Likewise with Java: Java programmers are used to be thinking in certain
terms of object-orientedness simply because that's the way it has been
done in their language ever since (and this way differs from the
thinking enforced by C++ and Perl because their object-orientedness has
had a different flavour altogether).
The point is multipart:a) although you have long accepted Perl to be
more than text processing and regular expressions that opinion spreads
slowely,
It's about time that certain things sink into the mindset of a Java
programmer: Namely even when a lot of text-processing is involved on the
surface of the source code, this does not necessarily mean that the
program itself is so obviously text-based. I frequently hear Java in
connection with terms such as XML and DOM. This is nothing but
text-processing (in which, incidentally, regular expressions could come
in extremely handy).
Tassilo