what makes Perl Perl?
In no particular order:
- Perl is context-based, or context-sensitive, or it decides what to do on code depending on in what context I expect my code to be treated (well, in the set of contexts Perl understands)
- Perl allows me to code in the *first way* that comes to mind to solve a problem, yet allows me later to improve the solution in *another way*.
- Perl makes it easy for me to visually distinguish variable types and interpolate them in string. This is one of things that made me fell in love in my early Perl days.
- Perl allows me to have as many namespaces as I like (or need) and arrange them in a nested fashion. I can have them in one file, or in their own files. (I just can't stand to say CGI_Application_Plugin_Authentication_Driver_DBI).
- Memory management. Well, this one was actually less relevant for me until I know (by literature) the pain in manually allocating and deallocating memory. So my praise to those who implement Perl in C but can stand the pain :-) (They can, can't they?)
- Garbage collection, see also note about MM. I don't care whether it's implemented with reference counting or mark & sweep, or other techniques, as long as Perl provides GC.
- CPAN, enough said :-)
- Unimitable Regular expression
- Optional parentheses, semicolons, and commas as long as they're not required
- I love one-liners
- Optional return in subs (TheDamian advices againsts it (PBP 9.11), though.)
- POD!
- Free-form syntax structure
- Short-circuit in logical operators
(I don't know how to name this) EXPR if STATEMENT and other statement modifiers friends (Updated per blazar below)
- Closure, anyone?
- Arbitrary (bare or named) block usage
- Nested scoping
(Well, I can go on but that's what I can think of now. I could add TimToady's onion speaks but I'm afraid it's too much personal)
If Perl 6 preserves those characteristics, there's no reason to say Perl 6 is not Perl despite the change on the syntax. For example, I don't mind to write @array[1] instead of $array[1]. It's still Perl. And of course I can't mind to write:
given ($some) {
when 'body' { 'has to fight' }
when 'thing' { 'has to give' }
when 'day' { 'they will know the truth }
when 'where' { 'in a very near place to their mind' }
when 'time' { 'can only tell' }
default { 'yes, there is always a space for default' }
}
In the mean time, the only thing I can do now is stay with Perl (5) until the day when we do have that better Perl than Perl 5. In the future, we won't call it Perl 6 anymore, just Perl.
Update: now that I remember more, I added number 13 onward.
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|