Best of The Perl Journal
All three volumes reveal a good hand at choosing articles and editing the contributions; after spending three years as a magazine editor I know that not all the contributors could have written this well. The writing is consistently good, tight, well edited and readable.
Across them all you will find articles by almost every major contributor to Perl and a great many of the people who have contributed major modules to CPAN. It's good to feel that perhaps a few cents from your book purchase is flowing into each of these pockets and repaying their work.
Viewing the 3 books as a whole my one real concern is that perhaps a little tighter restrictions on the article choice may have been better -- some of the articles are really only of historical interest, discussing methods overtaken by further development in Perl or the modules available. You may also find only one or two of the volumes contain articles of particular interest to you, I discovered that my favourites were spread across all three and bemoaned the semi-arbitrary division of topics as I only closely read about two books worth from the three volumes -- of course your milage may vary.
The first and largest volume, Computer Science & Perl Programming, is the one volume where I read and enjoyed almost every one of the seventy articles (by 41 different authors) included. The topics covered vary widely, from an essential trilogy of articles about regular expressions by Jeffrey Friedl to some esoteric discussion of Perl internals by Chip Salzenburg.
The second volume, Web, Graphics and Perl/Tk, contains 39 articles, around half of which are devoted to topics such as mod_perl, spidering, and other web stuff. Here is where you can find yourself reading an article about topics now made redundant by changes to Perl and its modules. The graphics section is an eclectic mix while the Perl/Tk section adds up to a fairly good tutorial on the topic.
The third volume, Games, Diversions and Perl Culture, collects 47 articles on a broad range of topics: 15 of them are about various sorts of language processing in Perl that I found extremely interesting. It also includes the Obfuscated Perl Contests, the Poetry Contest and a bunch of other "silliness." An article on how the magazine's covers were photographed seemed particularly pointless.
I'd recommend the first volume for almost anyone interested in Perl. The second might be worth purchasing if you wanted the web coverage. The third is worth it if you want the coverage of language processing or have an interest in the culture that surrounds Perl. Check the O'Reilly pages for one, two and three to see the tables of contents, index, grab the code examples and download a sample chapter (the third volume has two example chapters.) I've given the first volume an 8 but the other two get 7 and 6 respectively as the article choices make them less useful, though the quality of writing and editing is as good.
I think all three would be a marvelous addition to any decent tech library - they seem perfect for a library as they have all the benefits of a five year collection of TPJ without the problems of magazine storage, cataloging and conservation. For everyone else, grab the first one and then decide based on the content for the other two.
You can purchase Best of the Perl Journal (Volume 1, Volume 2, Volume 3) from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Perl: Great thing to write, but people aren't sufficently motivated to read it unless they're trying to find something to use against you :|
Anti-slash: In sacred jihad against slashdot
Are they in your opinion worth reading if you haven't learnt perl yet? Its on my list to learn this year
It could be that the purpose of your life is only to serve as a warning to others.
I'll never forgive CMP for running Byte Magazine into the ground only 4 months after I subscribed. They robbed me of 8 months' worth of subscription money and they even had the nerve to suggest switching my subscription to Windows Magazine. The horror! at least Byte was more encompassing and had general-interest articles about other platforms and computer science in general, not just Windows blabber and publicity. The thieves.. filthy little thieves... Don't ever let CMP run your magazine.
Hit reload? Looks fine to me.
I got "Best of the Perl Necklace 3" for Christmas, do I need to have seen 1 & 2 to understand it?
This
for Perl users if each entire article had been written on one line with no punctuation or spaces.
"Write-Only"
Maybe you hang out with the wrong kinds of people. I know people who take great care in making their code readable and well-commented, even when it's perl.
It even seems to be affecting some of the comments. Not all of them, though. There must be some sort of weird bug in the Slashcode.
Hear recorded Slashdot headlines on your phone! New service beta testing. Just call (248) 434-5508
Yes, of course there are individuals who code in all kinds of languages who write poor code. I was merely making a shallow generalization based on personal experience. Hey, it's slashdot, why not? :)
I always save my last mod point to mod up a good troll. You people are too serious.
Its only cryptic if you want to make it cryptic.
Look at this cryptic code:
open(FILE, "/etc/passwd");
while($line = <FILE>)
{
print $line;
}
close(FILE);
There must be some code in the comment submission code that checks makes sure all tags are closed and closes them if not (so posters can't screw up the rendering). Is there some reason that this same code can't be used in whatever script the editors use to post stories?
Just curious, seems this happens at least once every few months.
-- Fighting mediocrity one bad post at a time.
ADA is most definitely not gobbledygook. And Perl is one of the worst offenders of gobbledygook.
I'm so out of the Perl loop that if I just need to do some text parsing, I'll use AWK every day over Perl. Understand, of course, that Perl is more than just text parsing; its truly the duct-tape of the web...
In the future, I would want to not be isolated from my friends in the Space Station.
So, uh, what does it do?
FYI: The close-tag for is not optional.
I think you mean that it would have been more readable to Perl users if it had been written in punctuation and spaces.
perl -e 'print pack("H*","4675636b206f66662e")."\n"'
Highlights how not to write Perl code since there's no bang line, strict pragma or scope controls and the grandparent is relying on the obtuse open() call rather than using the FileHandle module which would've been much cleaner.
Oh uh... and it does exactly what he thinks it does all the same, except for the last line may or may not print out. Ah, the power of Perl, TMTOWTDI:
Should do exactly the same thing. S'why Perl's great - do it however you want. I think my way is more elegant, but I also thing the original way was much clearer to the non-Perl slinger.Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
Gee... I wonder what that does... it's so cryptic.
Your OS : written in C
Your Word processor : written in C
Your Browser : written in C
Your Email Client : written in C
Your Spreadsheet : written in C
J4v4/r00by/pyth0n/p3rl/vb R00lz, u 3litSt p1G !!!
Is it blank? ;)
Holy shit - when I first saw this I though /. was getting
finally getting a bunch of otaku wanker trolls from SA.
The only reason for Perl's popularity is the elitists who get kicks out of other people not understanding their code.
Perl encourages people to write very compact, easily readable code in perl. Ofcourse, some familiarity with basic syntax is needed. However, many people write code in perl just like they are writing AWK or C code.
Just to contrast, have you seen any C++ code generated by Visual Studio? How would that code look to someone not familiar with the environment?
Here is a cut down example of easy to understand code from the CGI page... well, lameness filter is complaining too much. Anyway, if you do perldoc CGI, you will see how it looks.
S
Communism. What is it all about... is it good, or is it whack?
:-) All in good fun.
I am sorry but if you are disciplined enough to write tight code always, it matters shit little what language you use. Yeah, Perl can be a mess, but what it doesn't waste on nonsense like coding style, it makes up for in spades in doing what you want it to do -- friggin time. Now that being said, I don't use Perl for everything. PHP is my web language now, but I'd be damned if I would write do something like SNMP data collection with anything other than Perl. The modules are there to make it easy and if I have to get crazy and parse snmpbulkwalks and such, it can do the job with out me worrying if I put a fucking tab in the right place.
Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
So, they either need to rename or overwrite logon.scr and they need to copy or rename usrmgr.exe.
Not that I'm saying that's not the out of the box config, mind you.
Communism. What is it about?
Is it good, or is it whack?
In Soviet Russia, as follows:
Communism. The Party tells me what it is about!
It is good! Yes, very good!
Oh yes, Perl encourages people to write code that Perl can easily read. For people is a little harder.
"I think this line is mostly filler"
#!/usr/bin/perl -w ;-)
#relax I'm just being a picky Perl person
#I could be Christiansen and call you a godless moron
use strict;
open(FILE, "/etc/passwd) or die $!, "\n";
while(<FILE>) {
print $_;
}
close(FILE);
exit;
Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
LOL, can you imagine the reaction of the Arby's drive thru worker? "Teh"? WTF is "teh"?
Only for completion.
A shorter version might be:
#!/usr/bin/perl -w
system("cat
That looks more cryptic that it needs to be.
Heh.. yeah, but if you wrap a single system call in a Perl or shell script, you should be shot.
Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
I call shenanigans! File::Slurp is not a standard module! Cheater! Cheater! :p
Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
Should read:
based on limited personal experience.
Perl isn't that bad! Most programmers should at least be able to read the following...
...]";
#!/usr/bin/perl
# Word counter -- takes in a text file, outputs
# the frequency of each word found in said file.
if ($#ARGV < 0) {
print "Usage: $0 textfile [textfile2
exit;
}
while (<>) {
foreach $word (split) {
# Split the lines we ate from <> into words.
# I.E. things separated by whitespace.
if ($count{$word}) { # If it already exists.
$count{$word} = $count{$word} + 1;
} else {
$count{$word} = 1; # First time seen.
}
}
}
foreach $word (sort keys %count) {
print "$word occured $count{$word} times."
}
# Easy & nifty, no?
I hear people say "teh". In the real world. They actually speak phrases like "teh suck". It scares the hell out of me.
In 2018? And why the fuck are they obsessing with the interpreter framework when the fucking language is not designed yet? Talk about poor planning.
Might as well just be:
/etc/passwd
#cat
Just to contrast, have you seen any C++ code generated by Visual Studio? How would that code look to someone not familiar with the environment?
Ah yes, being familiar with the environment would help but it is still awful obtuse.
I always thought Perl got a bad rap for encouraging bad hard to read style.
I have worked with old C code so badly written that it was a nightmare to figure it out. It used massive global data via nested (and redundant) includes files. The original authors relied heavily on command precedence and so it as a challange to untangle a single line. And this was code written by a major defence contractor.
But few complain about C propensity for obfuscation. Why is that? And C++ just ups the obfuscation ability a notch or two while significantly adding to the vocabulary.
I suspect Perl's built in reg exp has been the result of most complaints. But a single reg exp can replace pages of code.
I guess typing cat /etc/passwd would be too easy?
Some junior scripters and sysadmins that use perl probably haven't spent 1/100th time on "learning perl" as they would have spent on "learning C".
:), I spent the time on asking for help and later easily understood the code.
Consequently, people get stuck with a very limited set of tools in the language, and (many are stuck in the perl4 syntax I believe), and write code accordingly. To a newcomer that reads such code, it becomes a nightmare.
I found Visual Basic code written by someone very complicated. Turns out that the code was written in a very adhoc manner. Not being familiar with Visual Basic, I could have easily concluded VB is hard to read. Being mature
S
Always, I mean ALWAYS,
check return status of system calls!
open(FILE, "/etc/passwd") or die "open err: $!\n";
Anyone thought about doing a run of particular covers as posters?
I'd particularly like the one where someone attempts to compile perl on a typewriter.. (underwood? I can't find it in a GIS..)
I always wanted a computer book ;-) this one seems like it would suit me. Then again I have blown more than a few Sunday mornings reading www.perlmonks.org
Reading perl is almost as much fun as writing it. In it's more 'condensed' styles it is much more challenging (read: fun) to decode than java and the 'tmtowtdi' ethos sparks a lot of creative architectures.
For me learning perl was/is more fun than any other language I have tried, those docs can be hilarious. They also help keep your spirits up during late night deadliners, I hope this book has some of that.
perl modules are a bad way to go if you need any kind of performance. Your script takes over 10x as much CPU to run as the other poster's, the one that just did open(), while(), close(). .083 CPU seconds (on my pIII-600) for yours vs .009 CPU seconds for his. It might be more significant than this, actually, but it's hard to measure in much finer increments.
Most of the additional time is the loading of the module. Watch:
$ time perl -e 'use FileHandle;'
real 0m0.102s
user 0m0.083s
sys 0m0.016s
$ time perl -e 'use FileHandle;'
real 0m0.099s
user 0m0.075s
sys 0m0.023s
$ time perl -e 'use FileHandle;'
real 0m0.099s
user 0m0.089s
sys 0m0.009s
...why does Brad Murray need such a very big bed? (vol. III, authors) Wonderful books, by the way. Highly recommended, although you might want to browse them at your library or bookstore to see which one(s) interest you first.
Because everyone can understand the other guy's example and your code only makes you a smart ass. also known as the guy to fire because he things he is too hot.
I don't agree.
To someone who does perl for a living and is "good at what he/she does", the second example is much simpler to follow. It is more "perl-ish" and does not use unneeded variables.
Once you get into the perl mindset, the second example isn't as bad as it looks.
And thats why you should use something like mod_perl.
Bush and Blair ate my sig!
Then it is already too late for you, its getting dark... dark....
The problem people have with perl, including myself, is that if you ask 10 perl hackers to do the same task you are going to get back 10 completely different pieces of code.
This can be an incerdible pain in the ass to deal with, espically if you have to maintain somebody elses code when they code in a completely different manner than you do. Consider this...andI probably screwed up the syntax on the latter because I don't think you should have to scroll to the bottom of a block to see why you are executing it.
So even if you are very familiar with perl you may see code that doesn't make any sense to you.
perl truly is write once, read never code