Perl 5.22 Released 92
kthreadd writes: Version 5.22 of the Perl programming language has just been released. A major new feature in this release is the double diamond operator; like the regular diamond operator it allows you to quickly read through files specified on the command line but does this in a much safer way by not evaluating special characters in the file names. Other new features include hexadecimal floating point numbers, improved variable aliasing and a nicer syntax for repetition in list assignment. Also, historical Perl modules CGI.pm and Module::Build are removed from the core distribution.
News that matters! (Score:1)
Re:News that matters! (Score:5, Funny)
Oblig:
BEFOREHAND: close door, each window & exit; wait until time;
open spell book; study; read (spell, $scan, select); tell us;
write it, print the hex while each watches,
reverse length, write again;
kill spiders, pop them, chop, split, kill them.
unlink arms, shift, wait and listen (listening, wait).
sort the flock (then, warn "the goats", kill "the sheep");
kill them, dump qualms, shift moralities,
values aside, each one;
die sheep; die (to, reverse the => system
you accept (reject, respect));
next step,
kill next sacrifice, each sacrifice,
wait, redo ritual until "all the spirits are pleased";
do it ("as they say").
do it(*everyone***must***participate***in***forbidden**s*e*x*).
return last victim; package body;
exit crypt (time, times & "half a time") & close it.
select (quickly) and warn next victim;
AFTERWARDS: tell nobody.
wait, wait until time;
wait until next year, next decade;
sleep, sleep, die yourself,
die @last
Re: (Score:3)
I forgot the header
# Black Perl, adapted for Perl 5 by Jonadab.
# Adapted from Black Perl, as seen in the Camel,
# 2nd ed., p 553
Re: (Score:1)
First post! (Score:1)
Because I wrote it in Perl 6
Re:Second post! (Score:3)
So was it Perl 6 or you that failed?
Re: (Score:2)
For sufficiently {1940, Germany, Soviet Union} values of co-exist.
Re: (Score:2)
Perl6 is almost ready
Fifteen years in the oven, that better be one tasty cake!
Re: (Score:2)
Perl6 is almost ready
Fifteen years in the oven, that better be one tasty cake!
Well.. You KNOW it won't be half baked..
Yes folks.. I'm here all week and we have no cover... Please tip the waitress..
Re: (Score:2)
Re: (Score:1)
Nobody gives a shit about perl6, and nobody ever will. Just call it something else, for god's sake; maybe ivory. Python4 isn't quite the joke that perl6 is, but close to it. Changes in the evolution of a computer language that don't preserve backward compatibility are stupid. C++ got good adoption because the degree to which it was and is not a perfect compatible superset of C is extremely small. The tradeoff was extreme complexity and a profusion of multitudinous ways to do things. Hence the way was opened
Re: (Score:2)
Yes. Precisely.
Python 3.x is not Python 2.x by any means. Python 2 code won't work under Python 3, and safe conversion requires complete re-testing and so is unlikely to be a practical or sane option for many installations, regardless of tools that do it automatically. That's not to say that Python 3 might not be a better language than Python 2; just that it isn't the same language, any more than Ruby or Perl is the same as Python 2.
But this is one area where open source comes to the rescue.
Re: (Score:1)
Re: (Score:2)
It also uses the Parrot interpreter to do a neat trick; you can mix languages.
Well, no. Parrot support has been suspended in Rakudo Perl 6 [pmthium.com]. The other backends (MoarVM, Java) are faster and have more features.
So Perl6 can use C, Python, etc natively.
Even if Rakudo still supported Parrot, that would be only possible if C, Python support had been implemented on top of Parrot. Which is not the case. Parrot was a dream that never convinced much people.
Re: (Score:2)
I don't know about this idea that no one cares. Perl6 introduces a lot of interesting concepts and techniques, it is very advanced. Perl today is much smaller than Perl was when Perl6 was announced but still larger than Perl was during the days of Perl 4. I don't know whether Perl will make a comeback or remain influential. But I certainly believe either is possible. The ideas in Perl6 have already influenced mixed paradigm languages like Scala.
As for your example of C++ and C I think your history is
Re: (Score:2)
Considering this suggestion [slashdot.org] I'm glad to see that you did improve a bit.
Re: (Score:2)
bigint has been around for a while. Is that not what you want?
Re: (Score:2)
What's next, support for long integer arithmetics?
perl 5 already has built-in support for 53 bits integers on 32 bits builds (check perl -V:nv_preserves_uv_bits on your platform). If you want more your can use the bigint [perl.org] pragma.
Re:Impossible to care anymore (Score:4, Insightful)
Perl updates for the past ten years have been mostly unloved features and cruft. If 5.6 didn't get the job done then 5.22 won't either.
This is just a "look at me, I'm uninformed about the languages landscape" post (good thing you went AC). Like Perl or not, most people who care about open source development know that the Perl nuts have been busy backporting the ideas that were supposed to show up in Perl 6 to Perl 5.
Whether or not that goes anywhere is separate from being ignorant about what's going on.
Re: (Score:2)
Perl 5 is still waiting for Python, Ruby to catch up on the Unicode support that Perl had in 2002. And Unicode support in Perl 5 has improved since.
Perl 6 will even have support for graphemes [wordpress.com].
Perl still around? (Score:1)
Re: (Score:3, Insightful)
Re: (Score:2, Redundant)
Nah.... Python replaced Fortran 77. At least in the significant white space arena.
Significant white space? Seriously?
Re: (Score:2)
Nah.... Python replaced Fortran 77. At least in the significant white space arena.
Significant white space? Seriously?
Yea, what's old is new again!
It was a bad idea the first time folks, although there was justification back then due to restrictions in program size and character sets...
Stick around, I'm sure we will recycle a LOT of old ideas.... Trick is to line up the new name with the old...
Cloud Computing == Mainframe
Etc.. You try a few...
Re: (Score:3)
In those days they used punch cards so there *was* justification, it was a limitation of technology available at the time. To reintroduce it, 4 years after it was abandoned by Fortran 90, is a serious lapse of good sense. There is no good reason to have it other than as a joke or out of sadism.
Re: (Score:3)
"Etc.. You try a few..."
Graph databases = network databases and they sucked then as now
NoSQL databases = recipe card and network DBs and they sucked then and suck now
Java VM = UCSD Pascal
VMs = IBM VM OS
DevOps = 80's and 90's start ups where you had to do everything.... and it sucked
Browser = Thin client
IM = IRC
XQuery = Heirarchical databases which sucked then and suck now
OO languiages such as Java are converging on LISP and the LISP family of programming languages vindicating a language approach invented i
Re: (Score:2)
OO languiages such as Java are converging on LISP and the LISP family of programming languages vindicating a language approach invented in the 50's and which does not suck.
In what sense? If you mean first-class functions and the associated techniques and patterns, then this is not at all unique to Lisp. The real distinguishing feature of Lisp is code-as-data and manipulations on it, and mainstream OO languages are definitely not anywhere even close.
Re: (Score:2)
They are headed there. I think it started when reflection became mainstream.
Re:Perl still around? (Score:5, Informative)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
What kind of hick college gives a degree in computer programming?
Re: (Score:2)
Re: (Score:2)
Re:Perl still around? (Score:5, Informative)
Replaced where? Apparently not on my Debian servers:
# find /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file | grep "Perl script" | wc -l /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file | grep "Python script" | wc -l
119
# find
29
Re: (Score:2)
for f in python perl shell script; do printf '%s: %s\n' "$f" "$(find /{,usr/{,pkg/,local/}}*bin -type f -print0 | xargs -0 file | grep -Fi "$f" | wc -l)"; done
python: 11
perl: 39
shell: 260
script: 314
Re: (Score:3)
On my FreeNAS file server:
# find /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file |
grep "Perl script" | wc -l /etc /bin /sbin /usr/bin /usr/sbin -type f | xargs file |
grep "Python script" | wc -l
2
# find
2
Maybe not a fair comparison. :)
Re: (Score:2)
the exec + is asking for trouble. exec \; is asking for slow.
the correct way is, as you mentioned, -print0 | xargs -0
Re: (Score:2)
Isn't Ruby the true heir to Perl, though?
That was the theory. People got tired of waiting for a fast, memory-efficient runtime. Python is faster, if you have tremendous amounts of memory and can accept the syntax.
That perl hasn't been supplanted by a better scripting language doesn't say as much about perl as about everything else. There's some scuttlebut that Rust may do that, but it's early days and Mozilla still has plenty of opportunity to destroy it.
newLISP is the future of Perl (Score:1)
Ruby was built from an insecure and crash-prone mindset. newLISP is like Perl... but readable!
Re: (Score:2)
@Bill
Why do you consider Rust to be a scripting language: compiled, no garbage collection... ? I'd consider it more a competitor / modern update to C or Forth than Perl or Ruby. So I'm curious where you are coming from on this.
Re: (Score:2)
No, Ruby was a fad for hipsters. Python is the true heir.
Tab. Now with Aspergerstame. Sweet! (Score:2)
Yes. Much better to type 4 or 8 spaces when you could have just hit tab once. I totally see your point. You bet.
Can I subscribe to your newsletter?
Re: (Score:2)
Or you could use VIM, or Emacs, or basically any programmer's text editor in the entire bloody world. Except maybe ed. (Cool story: I once ported ed to win32 for the hell of it. By port, I mean "ripped out every hint of signals or POSIX". It worked, at least, if you can consider ed to be useful...)
Re: (Score:2)
If your editor can't tell you the difference between tabs and spaces, you need a better editor. It's 2015. No need to stick with weak development tools.
Which is not to say that Ruby isn't a fine language. It is. As is Python 2. And 3.
Re: (Score:1)
I though Perl got replaced by Python years ago.
In the same way that the crappy CGI programs written by crappy (non-)programmers space has been replaced by PHP, yes, Perl has been replaced by Python in many other write-crappy programs by (non-)programmer spaces. But hey, you can brag that objects are part of the language! (even though it's the same object system as Perl).
Re: (Score:2)
I wrote my sig in perl
hexadecimal floating point numbers? (Score:2)
Re: (Score:2)
That was my thought exactly. I nearly spit out my coffee when I read that wondering if it was some sort of joke.
Re: (Score:2)
It just those weird and wacky Perl Monks at it again...
Re: (Score:3)
And the funniest part of this all, is that exponential notation had to be changed to use p rather than e since e is a hexadecimal number.
use the 4's (Score:2, Funny)
195
$
Re: (Score:3)
It probably is mostly a "why not". I expect there will be a very few folks who will get some use out of being able to really specify an exact floating point value, though, instead of specifying a decimal float and having it turned into "the IEEE double which is closer than any other to that value".
Re: (Score:2)
I expect there will be a very few folks who will get some use out of being able to really specify an exact floating point value, though,
The folks who needed that have been casting byte arrays to double when they really wanted to set it to a specific bit pattern.
Re: (Score:2)
yep. This should be slightly more readable, but it's still definitely a niche feature.
Re:hexadecimal floating point numbers? (Score:5, Informative)
What's the use case for hexadecimal floating point numbers? Seems like a "Why not" feature.
Useful when you implement high quality transcendental functions and need floating-point constants that are guaranteed to be converted exactly as intended.
Re: (Score:1)
while $enlightened
print 0xMMMMMMMMMMMMMMM
Re: (Score:3)
What's the use case for hexadecimal floating point numbers? Seems like a "Why not" feature.
Oh no.. It's for the obfuscated Perl contest.... You can do amazing things with that..
Re: (Score:2)
Guaranteed Precision and Accuracy.
Re:hexadecimal floating point numbers? (Score:5, Insightful)
The use of hex floats is to be able to write out floats efficiently and with guaranteed full accuracy to a text file. You can use decimal but you need a LOT of digits in order to do so, making the files rather bloaty. The reason Perl now supports them I suspect is because they're now supported in a bunch of other languages such as C++, so if you want to be able to mutually exchange data, you need hex floats in perl too.
Pesonally, I like them. A lot of data one generates in numerics isn't exactly human readable, but is generated as text for easy parsing with the original language and other tools. For example if your algorithm generates a log of checkpoints you can restart interrupted computations (great for splitting work into smaller chunks for a cluster), for example. To do that properly, you need to be able to save the state without loss.
That's just one of many examples.
It's curious that people (not you) have been guffawing over how stupid Perl is for doing this. It's funny that a supposedly hackish community has a significant cadre who brags about their anti-intellectualism as much as any self-respecting highschooler.
Re: (Score:2)
The perldelta [cpan.org] mentions that there were a number of fixes/enhancements to floating point numbers handling implemented.
I'm not sure why the hex fp (a rather obscure feature) was singled out for the summary.
Re: (Score:2)
Obligatory (Score:2)
Re: (Score:2)
I'm surprised no one's posted this [xkcd.com] yet.
Actually, I've always been surprised at how reluctant many developers have been to accept regular expressions as a part of their trade. They are very useful shortcuts for string manipulation, and to Perl's credit they defined regex conventions for other languages, like Java and R, to name a couple.
Regex? That's my butler's name! (Score:2)
There is an issue of readability that crops up when maintainance is a consideration. Serious regex reads like APL after being put through a shredder.
I'd rather not use a regex if there's something clearer available:
myString.find('searchTerm')
myString.replace('searchTerm','replacementTerm')
On the other hand, when writing my own language (yeah, I know, shut up), one of the very first things I did was incorporate regex handling, so WTF. :)
Re: (Score:2)
But your examples aren't really particularly different when using regex, at least with a sane library. I mean, in Python, for example, they'd be re.search and re.sub, respectively, but everything else is the same.
Re: (Score:2)
to Perl's credit they defined regex conventions for other languages
Yes, but the Perl designer also learned from his mistakes (regexp become hard to maintain) to build a new regexp language ("grammars"), both more powerful, more generic and more readable and it's coming in Perl 6.
http://doc.perl6.org/language/... [perl6.org]
Re: (Score:1)