Re: What is modern Perl?
by eyepopslikeamosquito (Archbishop) on Dec 19, 2004 at 03:18 UTC
|
For an excellent definition of modern Perl, I'm honoured to
quote
the late Iain Truskett aka Spoon aka Koschei:
Check that the tutorial uses good, modern style. 3-arg open
(or at least whitespace between action and filename). Should
be advocating 'use strict' and 'use warnings' (which will
show it's at least 5.6 or later). Should introduce perldoc
very early on. Lexical filehandles. No ampersands when
calling functions in the ordinary case. /x both mentioned
and advocated for regex. POD. Other stuff. And most
importantly, security, including common sense and tainting.
In "Other stuff" above, I'd include a sound Test::More-based test suite (in t/ directory) with good code coverage.
Also, merlyn comments on a script that is not written in modern Perl style
here.
FWIW, I'd say Perl become "modern" around version 5.6, since that is the version that introduced lexical file handles, 3-argument open, and use warnings.
| [reply] [Watch: Dir/Any] |
Re: What is modern Perl?
by Trimbach (Curate) on Dec 19, 2004 at 02:43 UTC
|
| [reply] [Watch: Dir/Any] |
Re: What is modern Perl?
by graff (Chancellor) on Dec 19, 2004 at 03:54 UTC
|
For me, "modern Perl" refers to 5.8, with its use of utf8 internally for all character-based operations, its Encode module for inter-operating with virtually all non-Unicode character sets, and the PerlIO layers. The first two points make Perl a serious player (in fact, a tremendous asset) for dealing with human languages other than English, and PerlIO brings amazing simplicity to the scripting of some really powerful concepts.
When I write scripts using these resources, it's hard (or scary) to imagine how I would get my work done without them. | [reply] [Watch: Dir/Any] |
|
Yikes, I hope you don't mean 5.8.0 by that. If you are using all of those features, you want at least 5.8.4 IMO.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
Re: What is modern Perl?
by rinceWind (Monsignor) on Dec 21, 2004 at 13:29 UTC
|
I believe that the term "Modern Perl" was coined by Michael Saltzman in the title of his book Modern Perl Programming. The book is reviewed here.
Noting when this book was published, 2002, this would suggest that version 5.6.1 would be the baseline version of modern perl. I agree with this, in that I expect modules to be supported in this version and all subsequent. This is also the version I develop on primarily, owing to platform and user base reasons. I've also not had any need to embrace i18n and utf-8 in my applications, which are the main changes in the 5.8.x stream.
This version had "use warnings", "our" and lexical file handles, all of which I tend to make use of in my own modules.
-- I'm Not Just Another Perl Hacker
| [reply] [Watch: Dir/Any] |
|
Although I don't use it, I just learned that using & in calling subs is old perl.
| [reply] [Watch: Dir/Any] |
|
It isn't - it has a very specific meaning that most people don't intend. So, when they use it, it makes them look as if they coded in Perl4 where it did have the meaning most people intend.
Being right, does not endow the right to be rude; politeness costs nothing. Being unknowing, is not the same as being stupid. Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence. Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
| [reply] [Watch: Dir/Any] |
|