Perl 5.7.0 Released (Devel Version)
qbasicprogrammer writes "The long awaited Perl 5.7.0 version has finally been released! Source code is available from CPAN. If you haven't upgraded yet, now is the time. In related news, development of Perl 6 is continuing swiftly as demonstrated by the Perl 6 Library." Check out the head's up story saying that it was coming - just a reminder this is *devel*. Don't play with it unless you know what you are doing.
What's wrong with it? It's a devel version - it says as much in the story.
Yeah, I'm that guy.
Well, the idea behind Perl is a little bit different; it has too many decently implemented features to just be a scripting language, no matter how some people use it. It's humble, too--although it has the few useful features of Java, (packages and object-orientation, at least) it doesn't take the NIH approach and pointlessly rename everything like Java does. :)
:)
:) and 50 lines of C.
:)
I like C, too; because Perl is generally interpreted, and because of some of the features it has now, writing your average C-looking code in Perl isn't worth it--it'll be up to 10 times slower. However, writing code that takes advantage of Perl's features will perform much better, and can be expressed in much fewer (and easier to read) lines of code.
Examples:
- Being able to use a hash for quick lookup, or as an arbitrary name-space is really handy.
- A reference to a sub-routine functions as a closure, not as a function pointer; without this, functional programming can be more difficult to do...
- Arrays are readily growable, and can function as a stack, or other linear data structure.
- Extra types, like arbitrary-precision number routines, are readily available.
- CGI and database programming is ridiculously easy to do.
Finally, I wrote a program that takes arbitrary input line-by-line, and outputs sorted unique lines with a count of how many of each line it found. It took me 7 lines of Perl code, (counting the comment to run the Perl interpreter
The C approach dynamically grows the strings as needed, and using a dynamic array of pointers and qsort takes up a little bit more code than using a binary tree with a reference count, but they are both around 50 lines of code.
I haven't tested the two of them against each other yet, but the Perl code should be faster in general, for big files, because the built-in hash routines are algorithmically superior. (i.e. I don't think they have a worst-case of Order-n-squared...)
So, yes, a place for everything, and everything in its place. There are many times when Perl is the right tool for the job, and C isn't. I wouldn't write an Operating System Kernel in Perl unless I could make a *really* optimized compiler for it, but for many other tasks it's a much better choice. Besides, if you *need* to write something in C, you still *can*. And if you still don't like it, well, you can write a better language in C, just like they wrote Perl.
---
pb Reply or e-mail; don't vaguely moderate.
pb Reply or e-mail; don't vaguely moderate.
It's true that it's difficult to do much without creating an object at some point. However, you can do quite a lot of useful work in Python without understanding the OO model, inheritance, or any of those concepts. To me, the difference between C's "file = fopen(...); fread(file, ...)"
and Python's "file = open(...) ; file.read(...)" is simply a matter of syntactic sugar.
But you don't need to subclass some generic file class in order to create a file that's unbuffered, or is for writing instead of reading. Java's I/O library seems far more OO to me, in that you have to instantiate the right StreamWriter/Reader class.
And calling python "academic", as if that's a term of derision, is simply silly. It's not a language that has attempted to create new ideas in programming languages; it simply starts with different design principles and, unsurprisingly, ends up in a different place. See Tim Peters's "19 Pythonic Theses" for a (retroactively coined) list of principles.
Yeah, how DARE the GUY WHO RELEASED THE SOFTWARE warn people NOT TO USE IT without knowing exactly what they are doing, to counteract the original submissions saying "go upgrade now." Little wanker.
Slash (and Slashdot) runs on perl 5.005_03. It may run fine on perl 5.6. The current development branch of Slash, bender, is going to be tested on perl 5.6. We may upgrade Slashdot to perl 5.6 someday if it proves stable, or we might wait for perl 5.8.
BTW, I meant to add that I've run perl 5.6 on a machine with Slash and saw no problems.
Really? That's funny - I know a lot of people who 'got into Perl' by reading those books... Myself included.
Someone has to write good documentation and tutorials. Without it, not as many people would learn the language.
- Jeff A. Campbell
- VelociNews (http://www.velocinews.com)
- Jeff
Why should they? They've already given a lot back to the people who developed Perl by helping immensely in the spread of the language. This allows the coders to spend less time worrying about documentation and more time coding.
I haven't exactly seen Larry Wall or anyone else complaining about it - it would appear they are at worst neutral on the issue, and quite likely very appreciative. Wall in particular seems to be above jealousy over someone else *gasp* making money by writing about Perl.
- Jeff A. Campbell
- VelociNews (http://www.velocinews.com)
- Jeff
Check it use beat it up purge it system out of bugs
This a a quote from the perl site for thsoe who do not read the links
"Check that your favorite patch is in, check that your favourite module still
works, check that it still works on your favourite platform. Yes, I know it's a
development release, but I still would prefer not to wreak havoc more than
necessary," he said.
The roadmap chosen is to have 5.7.0 come out, and then take out the risky bits and call the result 5.6.1. So that should be arriving, probably within the month.
At the moment here are recent releases in terms of my trust for them:
5.005_03
5.7.0
5.6.0
Why?
Because there are a number of significant bugs in 5.6.0 that are fixed in 5.7.0. The worst of which IMO is this:
perl -e 'my $x = 10; $x = "2" . $x; print $x + 0'
(In 5.6.0 prints "10".)
Cheers,
Ben
My usual seat in the cluetrain is at A HREF="http://pub4.ezboard.com/biwethey.ht
Ah, you mean like 'sort | uniq -c'? :)
Still, Perl is very nice when your problem doesn't neatly fit the Unix tools approach, e.g. multiple-line records or whatever.
perl and Python are in competition for a few reasons:
Now, if they were both the same, there would be no point in them competing. perl and Python differ in several important ways:
Python regular expressions are now as powerful as perl's, but still not quite so convenient to use. A compiled regular expression is a first class object in Python, so you have a lot more control over when and where an expression is recompiled. This lack in perl is a major annoyance of mine.
I actually see Python as a viable (and desirable) replacement for perl in most instances. Of course, I tend towards the academic mindset. I suspect that people who would rather solve their problem than think about it too hard would vastly prefer perl.
Need a Python, C++, Unix, Linux develop
The list of RFCs for Perl 6 is pretty long. The changes look like they address a lot of the problems people have had with Perl. But how compatible is Perl 6 going to be with Perl 5? Will most packages/scripts need to be rewritten? Will the C extensions of Perl 5 need to be rewritten? I didn't see anything in the Perl 6 materials on the site that answered these questions (but maybe Larry addressed it in his speech).
Hmm, sounds like the development branch only just started, in that case.
"What a waste it is to lose one's mind. Or not to have a mind is being very wasteful. How true that is"
Vidi, Vici, Veni
Java is *100%* backwards compatible with older versions. New Java versions introduce HUGE amounts of new stuff - 1.2 did so in particular, but never has backwards compatibility been broken. Sure large API changes have been made in some areas, but the old API's still exist and are only marked as deprecated - not removed.
Perhaps it depends on how your mind works. Python is a highly disciplined language where in general there is One True Way. It's very easy to read. The object-oriented features of Python are more deeply embedded than those of Perl (read: the whole blippin' language is object oriented). And of course it's an excellent language for beginning programmers.
If Python points to the One True Way, Perl points to All Of The Many True Ways. It doesn't impose its structure on you. This can be bad if your mind demands structure; it's good if, like mine, your mind is completely unstructured (some might say "loosely hinged") but you occasionally want to impose structore onto it -- though only if you have to, not because the language demands it. What with the regular expressions and variable designators ($%@ and their friends) Perl is occasionally compared to "executable line noise." This bothers some people, although considering that my first language used variables like B! and X$ and U#, it doesn't bother me. The OO features of Perl are easier to avoid than Python's if you don't want to use them. And of course, it's an excellent language for beginning programmers.
Python might be a better choice for writing large programs that are going to require a lot of maintenance, or that will someday be moved over to C. Perl definitely shines in the areas of system maintenance, quick one-off scripts and one-liners. One-liners in particular are impossible in Python because of its use of whitespace and newlines as delimiters, although Python's interactive mode is much better than Perl's. Both are good for rapid prototyping.
I would say check 'em both out and use whichever one suits you. I tend to prefer Perl, but that's just because it works the way my mind works. YMMV (Your mind may vary).
--
Someone you trust is one of us.
Please keep on reading those release notes... Perl 5.7.0 does NOT have "full Unicode support". It has some Unicode bugs fixed compared to 5.6.0, but that's it.
--
jhi@iki.fi
this is the Perl patch pumpking (release wrangler, if you will) speaking. Please read the announcement letter carefully. The bottom line: you should NOT install 5.7.0 into production use. Unless you know who are the perl5-porters, what is perlbug, and preferably, how to pronounce my name :-) you should not even think about installing 5.7.0.
--
jhi@iki.fi
Open hashes are O(k + m) where k is the length of the string (which is almost always miniscule, though the overhead is pretty large), and m is the size of the linked list, which is generated from overlapping mappings of keys.
Perl allows you to view the statistics as follows:
$num_elements = keys %hash;
$used_and_free_cells = %hash; # "used_cells/total_cells"
An important problem with hashes is that when you get full you have to rehash. This has an incredible cost (much more than simply copying out an array to a new larger spot in memory). If you never rehash, but you keep growing your data, then your linked lists will grow so large that m will approach n. An alternative solution would be to use a tree instead of a linked-list. But for larger data-sets, this defeats the purpose of hashes.
-Michael
It isn't very easy to miss a brace - if you miss a brace, the code is unlikely to compile. Of course, you might misplace a brace, but you might as easily misplace whitespace. And given that people tend to indent their code, in Perl you would actually have to misindent *and* misplace the brace to make an error that isn't bloody obvious from staring at the code 40 feet away. So.... you might as well say that in Perl, the purpose of the braces is to see whether you indented right. ;-)
Last time I checked, Python's regular expressions were inferior to Perl's in speed, ease of notation, and power/comprehensiveness.
It has been a while ago that Python copied Perl's regexes, so the ease of notation argument doesn't hold. Nor does the power/comprehensiveness argument.
I program a lot in Perl and never in Python.
From the code I often see, I would say than more than half of the people programming in Perl would have been better off if they never had programmed in Perl but used Python instead.
-- Abigail
It's the bunch of freaks and geeks meeting at Larry's for tea every Tuesday afternoon.
what is perlbug
That's the Beetle (with flower power decorations) donated to Larry by a certain German car maker.
how to pronounce my name
That's easy. It's Finnish, so you just have to pronounce it the way it's written.
-- Abigail
perl -wne '$_ {$_}++; END {print "$_{$_}: $_" for sort keys %_}'
And you are right. You only have to add a tiny bit of code to do it for each word.
perl -nalwe '$_ {$_} ++ for @F; END {print "$_{$_}: $_" for sort keys %_}'
-- Abigail
As was announced with Perl 5.6.0, Perl is now following a release style similar to Linux - even numbered releases are 'production' releases (e.g. 5.6.x, 5.8.x, 5.10.x), odd numbered releases are 'development' releases (5.7.x, 5.9.x, etc).
I haven't checked out the change summary yet - I wonder what's been improved. My personal hope is the Perl compiler (B::C, B::CC, etc). Neat stuff!
No, then it wouldn't be a quote from the story poster. It IS a good addendum warning about the status of the release. The story goes a little something like this:
Perl 5.7.0 Released (Devel Version) Posted by Hemos on 07:51 PM -- Sunday September 03 2000
from the makin'-time-with-the-camel dept.
qbasicprogrammer writes "The long awaited Perl 5.7.0 version has finally been released! Source code is available from CPAN. If you haven't upgraded yet, now is the time. In related news, development of Perl 6 is continuing swiftly as demonstrated by the Perl 6 Library." Check out the head's up story saying that it was coming - just a reminder this is *devel*. Don't play with it unless you know what you are doing.
Note, the stuff in italics is a quote from the story poster and the addendum on the bottom talking about it being *devel* is Hemos being a good journalist, actuarially quoting the story poster in it's entirety and informing the reader with a stern warning in the headline and the tagline.
If you want stuffy editors filtering your content, goto the nytimes. This is /. it ain't all right but it's allright.
Larry Wall speeks at Dr. Dobbs about PERL6.
- Python uses indentation as punctuation. This could be great or terrible. Look at it this way - if you write perl per `perldoc perlstyle` you're describing block structures twice - once with indentation level, and once with braces. This naturally leads to errors where the indentation (highly visible) is correct but a brace is missing or extra. Python lets the visible thing (indentation) take on the syntactic role. The downside, if any, is that you lose the freedom to indent code however you want.
- Python is believed to have better object-orientation than Perl. Since I don't have the OO religion, this makes very little impression on me.
- Python is purist/academic in flavor, while Perl is eclectic/pragmatic. Perl's power is strongly tied to its mixed ancestry. Perl basically swallowed C, shell, and either sed or awk.
- Last time I checked, Python's regular expressions were inferior to Perl's in speed, ease of notation, and power/comprehensiveness. This may not be true anymore.
In case it's not obvious, I'm a bit biased towards Perl. I program a lot in Perl and never in Python. The one place I can imagine Python being superior is a largish team of newbie programmers. The enforced indentation would help ensure uniformity of style, and the bias towards object orientation might encourage modular and reusable code.Its pretty obvious that no one really knows yet what perl6 is going to be.
Some factions are gunning for radical changes, others (notably Tom Christiansen) seem to be holding a conservative stance.
One thig is certain - perl6 is not coming in any form anytime soon. Try 2002.
Hopefully it'll help speed up certain unnamed (*cough* /. ) perl generated sites. ;-)
``We are the people our parents warned us about.''
I have to say anyone with half a brain, who is in charge of doing the upgrades for PERL in their production environment would also be bright enough to catch the DEVEL in the title of the article, or if worse came to worse, would read the notes regarding the fact that this is a Development Release and not for production.
Alas, a more savvy 'journalist' would have edited the original statement, but at some point in time you have to assume the audience has a base intelligence in regards to the subject matter. Anyone who believes a random report to make business decisions will always end up with the short end of the stick.
This is not the way to build a lasting empire.
what the fuck is your problem? I think it is nice for once to warned not to install as it is a development release. Too many people have the habit of just rushing out and installing the latest whatever and totaly screwing up their systems.
--- Users are like bacteria -> Each one causing a thousand tiny crises until the host finally gives up and dies.
My purpose is NOT to start a religious war, but to honestly learn which to work with.
Only Women Bleed (Sex, Sharia remix)