Re: When you first encountered Perl, which feature amazed you the most?
by Tux (Canon) on Mar 04, 2025 at 10:51 UTC
|
Missing the "All of the above" choice :)
I started with perl-4.016 replacing my awk,sed and sed scripts collection. Soon after I implemented a Unify database UI into perl-4 taking oraperl as example code. It saved me tons of time and prototyping became a breeze (had to do part of the work in K&R C code those days).
I got lots of help from the community, which was a lot smaller those days.
Internet was expensive on dial-in modems, so off-line manuals (and books) were vital, and they were way above average and really helpful.
Conversion scripts vor awk to perl and sed to perl were included in the basic distribution, which was how I learned my first perl coding.
The error messages where spot-on most of the time.
But most amazing was how well perl code matched my way of thinking. The TIMTOWTDI might have been what kept me using perl up till today.
Enjoy, Have FUN! H.Merijn
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by QM (Parson) on Mar 09, 2025 at 12:00 UTC
|
Regexes. Before I was introduced to Perl (4 briefly, but 5 soon after), I had been taking classes about automata, language parsing, etc. The regex capability was killer.
Before that, I'd mostly been using Pascal (because of work), and doing any kind of matching the hard way was a PITA.
However, one of my classes had a token lab joint project, to practice "network" communications. My contribution came from the Camel book, almost verbatim. Another win.
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by dsheroh (Monsignor) on Mar 04, 2025 at 09:26 UTC
|
Voted regexes, but it was actually the other way around. I had developed a taste for vi and started learning about regexes to give me additional vi tricks, then discovered that there was a programming language which also had exceptional regex support and checked out Perl to see what it had to offer. | [reply] [d/l] [select] |
Re: When you first encountered Perl, which feature amazed you the most?
by bliako (Abbot) on Mar 04, 2025 at 13:06 UTC
|
I was initiated to Perl by someone at university who was ecstatic at how quickly one could set up a server and a client using sockets. At the time I was quite happy with C and was willing to go the extra mile (literally a mile of extra code, in length), in order to work with sockets. What impressed me in Perl was the ease of string construction/manipulation and regex searching/replacing. It was also the first time I saw hashtables and that impressed me also (by that time though they were already offered by awk). It was a few years before the millenium. And at that time, I initiated someone else, he was after easy regex searching in text. For years in my CV I wrote that I prototype in Perl and then use C for production. I think I still stick to this, though nothing goes to production these days.
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by Discipulus (Canon) on Mar 04, 2025 at 11:20 UTC
|
♫♪ (slow reggae) ♫♪♫
When I was just a kid
Someone told me if you will
Try to start coding in Perl
I've tried and I'm pleased still
I said it lingers deep within my soul
♫♪♫..
As stated elsewhere when the last millennium was ending I wrote some HTML tags and I looked at the results on some extinct browser. Then, almost immediately, I started coding in Perl to automate some system task on a small BugsLab's network.
I was fascinated by sigils :) and everything looked like magic (and it is).
But probably what amazed me more was Perl's error reporting system: it was always pointing clearly to my errors so that my errors became easy to fix. I used diagnostics a lot. My english was terrible and self.. teached ;) it means everything was really clear.
The above about error reporting is still true: I love it. So yes DWIM and help me doing it correctly too.
During the decades it happened to me to glance at other languages briefly (Python and PowerShell for example) and the third time they spitted out a flow of unreadable lines of errors I quitted. I'm really patient
Another impressing thing was The community but I'd add The Culture ..here you are!
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
| [reply] [d/l] [select] |
Re: When you first encountered Perl, which feature amazed you the most?
by johngg (Canon) on Mar 04, 2025 at 12:05 UTC
|
What got me interested in Perl was a Dr Dobbs article that illustrated the power of regular expressions. However, what really impressed me once I started using it was the ease with which one could manipulate strings with substr and the "." operator; so simple after the painful tooth-drawing of strcat, strcpy and their ilk in C. Also what could be achieved in just a few lines of code that would perhaps have taken 50 in another language. Laugh out loud amazing!!
Update: My first use of Perl pre-dated the four argument form of substr and being able to do this was a revelation ...
johngg@aleatico:~$ perl -Mstrict -Mwarnings -E 'say q{};
my $str = q{abcdefg};
say $str;
substr( $str, 3, 0 ) = q{xxxxx};
say $str;'
abcdefg
abcxxxxxdefg
| [reply] [d/l] [select] |
Re: When you first encountered Perl, which feature amazed you the most?
by talexb (Chancellor) on Mar 09, 2025 at 22:23 UTC
|
I was used to building multi-level data structures in C, but you had to declare everything first, and decide if it was going to be on the stack (with some size limitations), or in the heap (then make sure you free'd everything you'd malloc'd). In Perl? No worries, mate! Just start using the thing you want, and Perl magically makes it spring to life.
The community is pretty awesome too. :)
Alex / talexb / Toronto
For a long time, I had a link in my .sig going to Groklaw. I heard that as of December 2024, this link is dead. Still, thanks to PJ for all your work, we owe you so much. RIP Groklaw -- 2003 to 2013.
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by harangzsolt33 (Deacon) on Mar 04, 2025 at 03:09 UTC
|
I was really amazed that the arguments of a function are a list (@_) and can be accessed like the elments of an array. That was really interesting. I have not seen this in any other language. It reminded me of coding in assembly. | [reply] |
|
| [reply] |
|
JavaScript is much younger than Perl, and Brendan Eich admitted that he was influenced by Perl.¹ Perl was THE dominating scripting language back then.
It's also easy to prove if you list the semantic similarities.
It's just the syntax that has to be similar to Java because of the joint venture of Netscape with Sun Microsystems.
Brendon was originally hired to implement a Scheme (Lisp) based integrated language, similar to what was the case with Auto CAD and Emacs. (So one might argue if it's just a feature Perl copied from Lisp.)
Emacs was the (or one of the first) apps to come with an integrated high level scripting language and it proved to be extremely productive.
¹) I read it once in an interview but I can't find it anymore.
There is a tendency to punish Perl with silence, to weird it mildly.
The WP page of JS doesn't list Perl as influence, tho even the comments in the code base cite perl.
Most clearly with
- Array methods which are named like in Perl (pop, etc)
- String matching methods
- Perl 4 compatible Regexes
- "Strict mode" (later add on)
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by Ratazong (Monsignor) on Mar 05, 2025 at 09:05 UTC
|
Coming from C, hashes were the feature that I liked best at the beginning. But now (after some time using perl for automating my tasks)
I think that the simple way to use RegExes is the best. I love that!
| [reply] |
|
That, and the feature that you don't have to wrangle data types all the time. I don't mean the usual scalar/array/hash/ref thing in Perl. But more on the "oh, you want bigger numbers? Oh you want signed numbers?" side of things, like having to rewrite larger parts of the codebase because suddenly your database ID's need 64 bits instead of 32 bits...
| [reply] |
|
the simple way to use RegExes is the best
Come to think about it, this is still correct today when lots of other languages offer regex but none with the ease (basically zero setup code!) of Perl's. And if they do, they are copying from the original anyway. Enclosing regexes in quotes (in other languages) is another frustration of mine because I get this primordial feeling that some unwanted interpolation happened or I missed some necessary escape. Whereas Perl's / / / is comfort of mind. Perl's enclosing regexes with "any" character is an added bonus.
Perl, when it came up, offered exactly what the masses (never realised they) wanted and how they (never realised they) wanted it. The masses realised that what they got was exactly what AND how they would have wanted if they had the far-sightness of Perl's founders.
| [reply] [d/l] [select] |
Re: When you first encountered Perl, which feature amazed you the most?
by NERDVANA (Priest) on Mar 12, 2025 at 04:08 UTC
|
Nothing impressed me about perl when I first encountered it :-) It was only after being asked to implement things with it that I realized how great it was. I was coming from Java at the time, and I was most impressed with how effective perl's primitive-seeming building-blocks were at building advanced programs.
For example, in Java a hash table uses objects for keys, and each object needs a properly implemented hashCode() method which implements your concept of equality for that object. In perl, hash table keys are always strings, which seemed like a short-sighted generalization, until I realized that it really did fit all problems pretty well and saved me the effort of writing those hashCode() methods or even needing strong object types for the things I was putting into it.
Likewise, the concept of underscores denoting which methods are private on an object seemed crude at first, but then it just works rather perfectly. And how the storage for attributes is just a hash key of the same name as the method... in Java and C++ it's a constant hassle that the names of methods and names of field storage share the same namespace. I love how perl separates them.
I was also impressed that even though every single attribute access is a function call and a hashtable lookup, it runs decently fast. Coming from compiled languages, I never would have believed it. (but I did have an event where one of my designs was killed by Moose performance impact, so I abandoned that ecosystem fairly early)
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by hrcerq (Monk) on Apr 01, 2025 at 23:55 UTC
|
I certainly appreciate a lot of the features presented in the poll, but when I first encountered Perl (I believe it was close to 5.28), what really caught my attention were some features not listed here:
- Readily available in almost any *nix system (with consistent behaviour between them);
- Nice and pervasive documentation (very practical to query too);
- Great regard for backwards compatibility (if I write it today I'm confident it still works in ten years).
Still regarding documentation, I'd like to mention how POD is great when you'll document your own programs, and how perlintro quickly enabled me to accomplish the tasks I needed when I was getting to know Perl.
Also, I like its close relationship with UNIX and the inspiration taken from it. Makes Perl great for sysadmin tasks, which was (and to some degree still is) my focus when I decided to learn it.
return on_success() or die;
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by Jenda (Abbot) on Mar 05, 2025 at 20:15 UTC
|
It would be interesting to see historical data for this question. To see how the percentages of different answers changed over the decades.
I bet the "automatic memory management" used to a much bigger thing back in the day.
Jenda
1984 was supposed to be a warning,
not a manual!
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by LanX (Saint) on Mar 28, 2025 at 20:22 UTC
|
My scripting experience back then came from BASIC (and limited Bash)
I think what impressed me first was the for LIST syntax. And the metaprogramming with eval and `backticks`
I had prior experience with TCL for a job, and Lisp for Emacs, but don't remember much from this experience.
Bash has actually a lot of hidden features which are badly documented (it took me years to find out functions were possible) that's another point where Perl/perldoc shines.
My first Perl scripts looked a lot like bash, I even shelled out with backticks when I didn't know how to implement things in Perl.
Perl was good in slowly phasing in. (Problem is: Some people never left that get it done phase...)
I remember stumbling over map and grep wondering WTF these are needed to.
And I immediately got bitten by missing function signatures and prototypes.
sub func() {...} didn't do what I was expecting it to do...
And I ignored strict, I still have productive scripts which need to be adapted.
| [reply] [d/l] [select] |
Re: When you first encountered Perl, which feature amazed you the most?
by Anonymous Monk on Mar 04, 2025 at 10:25 UTC
|
Does "context" fall under DWIM? | [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by Anonymous Monk on Mar 06, 2025 at 16:53 UTC
|
I had been writing some CGI stuff in C when Sean Burke told me about Perl (4 at the time). I got interested and Perl is also the "king of the string" which matches up great with the textual nature of HTML and HTTP.
The real tipping point for me was the memory management but it all just fit so well with CGI in hostile conditions.
Thanks Sean!
| [reply] |
|
I would say that Perl is "the Sultan of the strings" ...
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by wisgest (Initiate) on Mar 27, 2025 at 00:51 UTC
|
Slices.
For example, let @f and @g
contain permutations of the numbers 0..$#f.
Then the product (composition) of these permutations
can be obtained in one step as
@f[@g].
It is also easy to obtain the inverse permutation
(swap indices and values): @h[@f] = 0..$#f (if there is no need to keep the source permutation,
then @f itself can be used instead of @h).
Assignment operators as lvalues.
I've always wanted to have in a programming language the ability to do something like this: ($x += 2) *= 3
| [reply] [d/l] [select] |
Re: When you first encountered Perl, which feature amazed you the most?
by Anonymous Monk on Mar 04, 2025 at 19:41 UTC
|
I was very naive, and of course hashes, regexes, etc., but I think the moment of amazement during just a few days/scripts was how seamless/effortless it was to mix binary IO/processing with text IO/processing, within adjacent lines, reading the same file. I.e., DWIM, I guess?
| [reply] |
Re: When you first encountered Perl, which feature amazed you the most?
by karlgoethebier (Abbot) on Mar 29, 2025 at 17:07 UTC
|
CGI.pm - the stuff that drove the ancestor of manroland - the first website i maintained back in the stone age.
| [reply] |