Beta

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Best of The Perl Journal

timothy posted more than 10 years ago | from the rdrs-dgst-vrsn dept.

Perl 123

honestpuck writes "Computer magazines come and go at an unrelenting pace. The Perl Journal was one of the better ones before Jon Orwant, the editor and publisher, passed it to CMP. It is therefore pleasing to find he has taken all the articles published over the five year period, removed the chaff and published the rest in three volumes." Read on for honestpuck's lowdown on what you can expect in this set.

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.

cancel ×

123 comments

Sorry! There are no comments related to the filter you selected.

You like communism, (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8091810)

because it will succeed this time. The mistakes of the past are behind us. Communism is enjoyable for the whole family, very much unlike scarlet fever, for example.

Are there enough Homo FUCKTARDS in NH (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8091920)

to vote for me so I can finish at least 2nd?
I'm afraid they are all sweet on Johnny Edwards---
Dr. Howard Dean

Re:You like communism, (-1, Offtopic)

dishonestpuck (732015) | more than 10 years ago | (#8092124)

Dear Slashdot: I have a confession to make. I am not really as honest as my name implies. In reality, I have been writing all these reviews in th e hopes of landing one of you nerds for some sweet anal love. You see, I have a fetish for fat greasy nerds. Anyway, I will try to be more honest in the future.

Furiously masturbating with thoughts of you guys,
'Dis'honestpuck

Re:You like communism, (0)

Anonymous Coward | more than 10 years ago | (#8092338)

Communism. What is it all about... is it good, or is it whack?

Re:You like communism, (0)

Anonymous Coward | more than 10 years ago | (#8092389)

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!

2004 Democrat Agenda (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8092873)

1) US acceptance of coexistence as the only alternative to atomic war
2) US willingness to capitulate in preference to engaging in atomic war
3) Develop the illusion that total disarmament by the US would be a demonstration of "moral strength"
4) Permit free trade between all nations regardless of Communist affiliation and regardless of whether or not items could be used for war.
5) Extension of long term loans to Russia and Soviet Satellites
6) Provide American aid to all nations regardless of Communist domination
7) Grant recognition of Red China, and admission of Red China to the UN.
8) Set up East and West Germany as separate states in spite of Khrushchev's promise in 1955 to settle the Germany question by free elections under supervision of the UN
9) Prolong the conferences to ban atomic tests because the US has agreed to suspend tests as long as negotiations are in progress
10) Allow all Soviet Satellites individual representation in the UN
11) Promote the UN as the only hope for mankind. If its charter is rewritten, demand that it be set up as a one world government with its own independent armed forces. (Some Communist leaders believe the world can be taken over as easily by the UN as by Moscow. Sometimes these two centers compete with each other as they are now doing in the Congo)
12) Resist any attempt to outlaw the Communist Party
13) Do away with loyalty oaths
14) Continue giving Russia access to the US Patent Office
15) Capture one or both of the political parties in the US
16) Use technical decisions of the courts to weaken basic American institutions, by claiming their activities violate civil rights.
17) Get control of the schools. Use them as transmission belts for Socialism, and current Communist propaganda. Soften the curriculum. Get control of teachers associations. Put the party line in text books.
18) Gain control of all student newspapers
19) Use student riots to foment public protests against programs or organizations which are under Communist attack.
20) Infiltrate the press. Get control of book review assignments, editorial writing, policy-making positions.
21) Gain control of key positions in radio, TV & motion pictures.
22) Continue discrediting American culture by degrading all form of artistic expression. An American Communist cell was told to "eliminate all good sculpture from parks and buildings", substitute shapeless, awkward, and meaningless forms.
23) Control art critics and directors of art museums. " Our plan is to promote ugliness, repulsive, meaningless art".
24) Eliminate all laws governing obscenity by calling them "censorship" and a violation of free speech and free press.
25) Break down cultural standards of morality by promoting pornography, and obscenity in books, magazines, motion pictures, radio and TV.
26) Present Homosexuality, degeneracy, and promiscuity as "normal, natural, and healthy".
27) Infiltrate the churches and replace revealed religion with "social" religion. Discredit the Bible and emphasize the need for intellectual maturity, which does not need a "religious crutch"
28) Eliminate prayer or any phase of religious expression in the schools on the grounds that it violates the principle of "separation of church and state"
29) Discredit the American Constitution by calling it inadequate, old fashioned, out of step with modern needs, a hindrance to cooperation between nations on a worldwide basis.
30) Discredit the American founding fathers. Present them as selfish aristocrats who had no concern for the "common man".
31) Belittle all forms of American culture and discourage the teaching of American history on the ground that it was only a minor part of "the big picture:" Give more emphasis to Russian history since the Communists took over.
32) Support any socialist movement to give centralized control over any part of the culture - - education, social agencies, welfare programs, mental health clinics, etc.
33) Eliminate all laws or procedures, which interfere with the operation of the Communist apparatus.
34) Eliminate the House Committee on Un-American Activities.
35) Discredit and eventually dismantle the FBI
36) Infiltrate and gain control of more unions.
37) Infiltrate and gain control of big business
38) Transfer some of the powers of arrest from the police to social agencies. Treat all behavioral problems as psychiatric disorders which no one but psychiatrists can understand or treat.
39) Dominate the psychiatric profession and use mental health laws as a means of gaining coercive control over those who oppose Communist goals.
40) Discredit the family as an institution. Encourage promiscuity and easy divorce.
41) Emphasize the need to raise children away from the negative influence of parents. Attribute prejudices, mental blocks and retarding of children to suppressive influence of parents.
42) Create the impression that violence and insurrection are legitimate aspects of the American tradition; that students and special interest groups should rise up and make a "united force" to solve economic, political, or social problems.
43) Overthrow all colonial governments before native populations are ready for self-government.
44) Internationalize the Panama Canal.
45) Repeal the Connally Reservation so the US can not prevent the World Court from seizing jurisdiction over domestic problems. Give the World Court jurisdiction over domestic problems. Give the World Court jurisdiction over nations and individuals alike.

HOW MUCH 4 TEH ARBYS SIGNATURE ROAST BEEF SANDWICH (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8091815)

Re:HOW MUCH 4 TEH ARBYS SIGNATURE ROAST BEEF SANDW (0)

Anonymous Coward | more than 10 years ago | (#8092457)

LOL, can you imagine the reaction of the Arby's drive thru worker? "Teh"? WTF is "teh"?

Re:HOW MUCH 4 TEH ARBYS SIGNATURE ROAST BEEF SANDW (0)

Anonymous Coward | more than 10 years ago | (#8092634)

I hear people say "teh". In the real world. They actually speak phrases like "teh suck". It scares the hell out of me.

Not to be confused with... (-1, Offtopic)

Yoda2 (522522) | more than 10 years ago | (#8091860)

...the popular adult flick "Best of the Perl Necklace"

Re:Not to be confused with... (1)

ellem (147712) | more than 10 years ago | (#8091942)

I got "Best of the Perl Necklace 3" for Christmas, do I need to have seen 1 & 2 to understand it?

Re:Not to be confused with... (1)

ClippyHater (638515) | more than 10 years ago | (#8092458)

Only for completion.

Best of Perl ? (-1, Flamebait)

EmCeeHawking (720424) | more than 10 years ago | (#8091866)

Must be a very thin book.

italics tag? (-1, Offtopic)

gTsiros (205624) | more than 10 years ago | (#8091868)

Think someone forgot to close an italics html tag... entire of /. appears in italics...

Re:italics tag? (0)

Anonymous Coward | more than 10 years ago | (#8091939)

Hit reload? Looks fine to me.

Re:italics tag? (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8091947)

Looks like July 12th 1983 was the last time posts weren't in italics on slashdot.

Or after this article: http://slashdot.org/articles/04/01/26/0319236.shtm l?tid=137&tid=142&tid=164&tid=185&tid= 187

Re:italics tag? (1)

britneys 9th husband (741556) | more than 10 years ago | (#8092096)

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.

Re:italics tag? (0)

Anonymous Coward | more than 10 years ago | (#8092316)

Dahij hsals itna eht nioj

Holy shit - when I first saw this I though /. was getting finally getting a bunch of otaku wanker trolls from SA.

Perl, yeah right (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#8091873)

Who wants to program in a language that can't even dynamically allocate memory ?

Re:Perl, yeah right (-1, Troll)

Anonymous Coward | more than 10 years ago | (#8091899)

Perl isn't the problem. The problem is that most people program in Perl on Linux, which is absurd to begin with since Linux doesn't even support USB, and all the new digital cameras are Perl based.

Best of Perl? (-1, Flamebait)

Anonymous Coward | more than 10 years ago | (#8091877)

The only reason for Perl's popularity is the elitists who get kicks out of other people not understanding their code.

Sure, it's "quick and dirty", but it's not worth the cost in maintainability.

Re:Best of Perl? (-1, Troll)

kneecarrot (646291) | more than 10 years ago | (#8091990)

I know the parent is a troll, but I can't help but agree. Anyone I've ever met who was a big fan of PERL invariably took pleasure in writing obscure and unreadable code. Oh well, it's only karma...

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092067)

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.

Re:Best of Perl? (1)

kneecarrot (646291) | more than 10 years ago | (#8092103)

Hang out with a PERL programmer? Are you crazy? :)

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? :)

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092369)

:-) All in good fun.

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092574)

Should read:

based on limited personal experience.

Re:Best of Perl? (1)

hey (83763) | more than 10 years ago | (#8092112)

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);

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092140)

So, uh, what does it do?

Re:Best of Perl? (1)

the_mad_poster (640772) | more than 10 years ago | (#8092248)

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:

#!/usr/bin/perl -w
use strict;
use FileHandle;
my $passwdFH = new FileHandle "/etc/passwd", 'r';

print $_ while(<$passwdFH>);
$passwdFH->close;
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.

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092468)


A shorter version might be:

#!/usr/bin/perl -w
system("cat /etc/passwd");

Re:Best of Perl? (1)

the_mad_poster (640772) | more than 10 years ago | (#8092533)

Heh.. yeah, but if you wrap a single system call in a Perl or shell script, you should be shot.

perl -e 'system "cat /etc/passwd"'

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092717)

Might as well just be:

#cat /etc/passwd

Re:Best of Perl? (1)

Mr Bill (21249) | more than 10 years ago | (#8092503)

That looks more cryptic that it needs to be.

use File::Slurp;

print read_file( '/etc/passwd' );

Re:Best of Perl? (1)

the_mad_poster (640772) | more than 10 years ago | (#8092563)

I call shenanigans! File::Slurp is not a standard module! Cheater! Cheater! :p

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092921)

No need for a module
#!/usr/bin/perl -w
undef $/;
open (FILE, "/etc/passwd");
$_ = <FILE>;
print $_;

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092848)

I guess typing cat /etc/passwd would be too easy?

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092274)

I know you are a troll but it prints the /etc/passwd file.


#!/usr/bin/perl
print "I know this is pretty hard to read so:\n";
while (1) { print "Fsck off!\n";}


Gee... I wonder what that does... it's so cryptic.

NOOOOOOOO! (1)

The Ape With No Name (213531) | more than 10 years ago | (#8092450)

#!/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;

Re:NOOOOOOOO! (0)

Abcd1234 (188840) | more than 10 years ago | (#8093372)

So, you "use strict", and even run Perl with -w, no less, and then proceed to make use of Perl's implicit variables? Why does that strike me as amusing... :)

Re:NOOOOOOOO! (1)

The Ape With No Name (213531) | more than 10 years ago | (#8094687)

Well, the discussion was about good coding practices of which strict pragma and -w are two examples. By the way, the above code doesn't run. I left a " out. Whoops.

Re:NOOOOOOOO! (1)

Abcd1234 (188840) | more than 10 years ago | (#8095894)

Which is why I find it ironic. :) Although it's a matter of personal taste, I wouldn't consider the use of Perl's implicit variables a "good coding practice"... after all, there's nothing like inexplicable magic to keep the newbs confused. ;)

Re:NOOOOOOOO! (1)

SenorFluffyPants (714110) | more than 10 years ago | (#8093389)

You don't need the $_:

open(FILE, "/etc/passwd) or die $!, "\n";
while() {

print;
}
close(FILE);
exit;

Or is that bad form?

Re:NOOOOOOOO! (0)

Anonymous Coward | more than 10 years ago | (#8095799)

You know nothing about the ancient rites of Perl.

#!/usr/bin/perl
@ARGV="/etc/passwd";print<>

which can be run on the commandline

perl -e '@ARGV="/etc/passwd";print'

or for the truly lazy;

perl -pen '' /etc/passwd

(another post nobody will read. sigh)

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8093348)

Always, I mean ALWAYS,
check return status of system calls!
open(FILE, "/etc/passwd") or die "open err: $!\n";

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092247)

perl -e 'print pack("H*","4675636b206f66662e")."\n"'

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092298)

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 !!!

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8092587)

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?

Re:Best of Perl? (0)

Anonymous Coward | more than 10 years ago | (#8093699)

Why write so much ?
#!/usr/bin/perl -nal

$count{$_}++ for @F;

END {
print "$_ occurred $count{$_} times." foreach (sort keys %count);
}

Re:Best of Perl? (3, Interesting)

sisukapalli1 (471175) | more than 10 years ago | (#8092322)

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

Re:Best of Perl? (0, Troll)

aled (228417) | more than 10 years ago | (#8092405)

Oh yes, Perl encourages people to write code that Perl can easily read. For people is a little harder.

Re:Best of Perl? (1)

Camel Pilot (78781) | more than 10 years ago | (#8092828)


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.

Re:Best of Perl? (3, Insightful)

sisukapalli1 (471175) | more than 10 years ago | (#8093079)

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".

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 :), I spent the time on asking for help and later easily understood the code.

S

Not unlike a real-life journal.... (3, Funny)

a XOR b XOR a XOR b (744728) | more than 10 years ago | (#8091887)

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 :|

Re:Not unlike a real-life journal.... (4, Insightful)

Junks Jerzey (54586) | more than 10 years ago | (#8091960)

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 :|

Oh, enough of that already. The bottom line is that a programming language you are unfamiliar with looks like gobbledygook. I suppose you think Chinese and Russian are gobbledygook, too.

Excuse me? (2)

mekkab (133181) | more than 10 years ago | (#8092128)

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...

Excuse you. (1)

The Ape With No Name (213531) | more than 10 years ago | (#8092372)

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.

Re:Excuse you. (1)

mekkab (133181) | more than 10 years ago | (#8092568)

what you want it to do -- friggin time.
well, only if you are using mod_perl... ;)

I am sorry but if you are disciplined enough to write tight code always, it matters shit little what language you use.

I can't agree. I've had some perl programs that were measly hundreds of lines of code. Strict pragma all the way. A couple of not-so-tricky RegEx's. The kid who "inherited it" couldn't figure it out so the project got shelved.

I see kloc upon kloc of ADA code... and even "Confusing" state machine loops are a breeze (in comparison to understand.
(that being said I find Text parsing in ADA to be a PITA and I'd rather do it in C!!! And I HATE text parsing in C!)

Call it a dumbing down for the coding masses, and I won't disgaree with you. But for large project management and areas with high turnover or no "component experts" (the guy who designed and wrote it left) there are languages that are just easier to read. A lot of that has to do with coding standards and style. But enough also relies upon the language itself. Some people get confused when they see:
My_array[ index++] = 12; /* a lil' C for ya */

because you are doing two things at once. Should they be able to understand that? Absofrigginlutely. But if they don't have to worry about semantics, they can get right down to the domain specific problems with the code ("uhm, your code sets the webserver on fire. Stop that.").

As for SNMP dumps, perl is nice cuz it can open the sockets and get the data. But if you gave me a dump ofthe data, I'd just as soon use awk to parse it out for off-line problem determination.

me worrying if I put a fucking tab in the right place.

GOD, I detest makefiles!

Re:Excuse you. (1)

allolex (563588) | more than 10 years ago | (#8094681)

I can't agree. I've had some perl programs that were measly hundreds of lines of code. Strict pragma all the way. A couple of not-so-tricky RegEx's. The kid who "inherited it" couldn't figure it out so the project got shelved.

Come on, either your code was poorly-written or the "kid" who took over maintenance wasn't competent. That's not intrinsic to the language.

Some people get confused by their own native language. It doesn't mean there's something wrong with Kannada, or Bahasa Indonesia, or English.

It comes down to having what is called an "ideal reader" in Literary Theory. You're writing with a specific ideal code maintainer in mind, and if your ideal reader's knowledge is not a subset of the real-word reader's knowledge, you've got a problem. So if you're dealing with substandard maintenance programmers, write the line that increments and assigns as two steps.

Re:Not unlike a real-life journal.... (1)

QuijiboIsAWord (715586) | more than 10 years ago | (#8092392)

Nah...its all Greek to me.

Re:Not unlike a real-life journal.... (0)

Anonymous Coward | more than 10 years ago | (#8093405)

"The bottom line is that a programming language you are unfamiliar with looks like gobbledygook. I suppose you think Chinese and Russian are gobbledygook, too."

Perl is, in my opinion, difficult to read due to it's poor syntax. That makes it, ultimately, difficult to use.

Hell. Roman Numerals look like "gobbleygook" to someone who is unfamiliar with them, but I think we can all agree that they're absoloutly horendous to work with.

Re:Not unlike a real-life journal.... (3, Insightful)

Daytona955i (448665) | more than 10 years ago | (#8092359)

Haven't looked at much perl code have you? Sure perl is known for it's obfuscated code contests and it's Haiku poetry [slashdot.org] . But I think this misconception arises from it's flexibility. I think it also comes from regular expressions which can get quite cryptic quite fast, especially if you don't know what it means.

However, as someone who just started learning perl, I think it's a great language. Learn a little about the language and then say it's hard to read. Heck, I could put all my c code on one line, does that mean it's a hard to read language?

Re:Not unlike a real-life journal.... (-1, Flamebait)

aled (228417) | more than 10 years ago | (#8092527)

I can't find the chapter on how to switch to Python.

No, wait! My karma is innocent!

Just a question (5, Interesting)

MrsPReDiToR (736605) | more than 10 years ago | (#8091902)

Are they in your opinion worth reading if you haven't learnt perl yet? Its on my list to learn this year

Re:Just a question (4, Insightful)

mekkab (133181) | more than 10 years ago | (#8092072)

YES. While learning perl hands on, I found a bunch of TPJs to be invaluable resources. Heck, I've still got a bunch kicking around (one or two that were pre-glossy covered), thats how useful they are. If I ever need to Perl again, I've got them as references.

I'd skip volume 3 (sounds kinda silly) unless you are a completist. Volume 2 sounds like the most useful and valuable- sure the article on Regular Expressions was GOOD, (I think I only read the first one) and understanding Perl internals would be a bonus, but the code examples of the web stuff is the best bet for my money.

So get (or borrow) Volume 2, if you like, get Volume 1, and if you become a raving perl maniac, have someone get you Vol 3 for a birthday present.

Re:Just a question (1)

MrsPReDiToR (736605) | more than 10 years ago | (#8092303)

Thanks for the advice. Im just a geek in training at the mo so any help I can get I'll accept!!! I know lots about too many subjects and not enough about any one thing. Perl appeals to me though so Ill let you know how Im doing next year!!!!

Re:Just a question (3, Insightful)

mekkab (133181) | more than 10 years ago | (#8092406)

Good luck.
The Camel Book is a great resource, too.

The secret to perl:
In other programming languages, when the compiler can't figure out what you are doing, it cries and gives you a cryptic error message.

In Perl, the compiler narrows it down to a few choices, flips a coin, and goes with one interpretation. Never mind that it wasn't what you intended! Frequent use of debug statements and USE STRICT pragma and USE WARNINGS pragma should help your code.

Re:Just a question (1)

haystor (102186) | more than 10 years ago | (#8093157)

One thing that helped me was learning that all the error messages are in the Camel Book.

your program should start:

#!/usr/bin/perl -w

use strict;

After that you should receive good error messages. When I look them up in the Camel book I'd say 90% of the time the book explains exactly what I had done wrong.

It's wonderful compared to the horrific error messages and stack trace spam that java gives me.

Re:Just a question (1)

stevey (64018) | more than 10 years ago | (#8093327)

Don't forget the often overlooked "use diagnostics;" either!

And if you're writing CGI's then for testing puposes something like "use CGI::Carp 'fatalsToBrowser';" can be a lifesaver too - but remember to setup something different when your code is in production use.

Re:Just a question (2, Informative)

chromatic (9471) | more than 10 years ago | (#8093357)

Add use diagnostics; during development, and you may be able to skip the Camel step in many cases.

Re:Just a question (2, Funny)

JamesOfTheDesert (188356) | more than 10 years ago | (#8093876)

your program should start:
#!/usr/bin/perl -w

Then, when that doesn't seem to help, you switch to

#!/usr/bin/ruby -w

# :)

Re:Just a question (1)

Kymermosst (33885) | more than 10 years ago | (#8093753)

I'd skip volume 3

Hey now, that's the one that has some of my code in it. Of course, I don't make any money off of it, and it's one of the obfuscated code contest 2nd-place entries... but I like knowing it's out there.

Re:Just a question (2, Interesting)

Anonymous Coward | more than 10 years ago | (#8092099)

Without having read the books you're referring to: probably not. I say that because Perl Journal material is/was pretty esoteric, and you'll spend a lot more time trying to figure out what they heck they're talking about than you will learning sleek, elegant, re-usable, intuitive, versatile, and fast coding methods. Which is what Perl really shines at.

Further, Perl is a language that rewards exploration. You'll discover 20 wrong ways of doing things, and one day you'll settle into one you like for your own reasons. There's often not a 'best way' in Perl, only 'your way'.

Not trying to scare you off. TPJ just isn't the best place to start.

Re:Just a question (1)

mekkab (133181) | more than 10 years ago | (#8092208)

Thats funny, my advise was a complete 180 of yours!

I think all your points are completely valid. However for Volume 2 (which appears to be web stuff) its nice to see some code that does it. It gets you up and running. Then later on you can decide if you want to parse everything by hand crafted regular expression pattern matches, or relegate the grunt work to some module you Dl'd off of CPAN.

Between TPJ and the Camel book I had enough to get my hands dirty and start writing some good code. I also lurked on comp.lang.perl and perl.moderated (once it split off), but that was more useful for esoteric finer points.

Re:Just a question (0)

Anonymous Coward | more than 10 years ago | (#8092577)

No.

I'm a habitual perl code thief, and have been pleased to steal other people's perl code from nearly all of the O'Rielly books, but I don't recall once stealing code from TPJ.

I write perl for a living and I thought that the TPJ was not very useful. Go get the Llama if you want to learn perl. I'm teaching someone perl right now, and would never dream of just handing her some magazine articles.

Re:Just a question (1)

allolex (563588) | more than 10 years ago | (#8094490)

The TPJ articles are directed at a more advanced audience. Depending on your programming experience, you should start with "Learning Perl" (less) or "Programming Perl" (more). The latter is a must-have for anyone serious about Perl. If you are more independent-minded, you can also use the perldoc documentation, but although it is very good, it is not as well-structured as, say, the PHP manual.

Re:Just a question (1)

Daytona955i (448665) | more than 10 years ago | (#8095609)

I've been reading the third volume and it has some interesting articles that you will be able to understand, I wouldn't try and learn from them. I would start with either Learning Perl or Programming perl (The Camel book) (or both). Once you start programming in perl, then I'd recommend getting the other books.

Damn CMP (4, Interesting)

Roadmaster (96317) | more than 10 years ago | (#8091909)

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.

Re:Damn CMP (2, Funny)

aled (228417) | more than 10 years ago | (#8092368)

Hey, they didn't offer Windows Magazine to me! Oh well, it could have been worst; they could had offer it.

Re:Damn CMP (4, Informative)

elmegil (12001) | more than 10 years ago | (#8092371)

Sorry, but by the time you subscribed to Byte it was little more than a trade rag, and had been for ages. The Golden Age of Byte was back in the early 80's when they actually put out articles of general interest to electronics/computer geeks.

Re:Damn CMP (1)

Craig Maloney (1104) | more than 10 years ago | (#8095879)

Yeah, the old Byte magazine was chock full of goodies back in the day. My parents bought me Popular Computing, but it was a special day when I picked up a copy of Byte. Had the best damn article on the computers behind the making of Tron than anyone else.

Remember kids, if you could fit 12 issues of Byte on your magazine shelf, you're not reading the golden age of Byte. :)

Would have been much more readable... (4, Funny)

drquizas (681020) | more than 10 years ago | (#8091944)

for Perl users if each entire article had been written on one line with no punctuation or spaces.

Re:Would have been much more readable... (1)

tcopeland (32225) | more than 10 years ago | (#8092171)

Heh. I'm looking at an August 1984 copy of "80 Micro", which was a magazine for TRS-80 users. On page 50 there's an article called "One-Liners" by a fellow named Harold Fink. Here's one of the better ones:
6300 W=0:FORV=1TOLEN(X$):U=ASC(MID$(X$,V,1)):IFU=47W=0: NEXTELSEIFWNEXTELSEZ=VAL(MID$(X$,V+1)):FORX=0TO1:X =0:IFZ<0Z=Z+1:
Whew. That's only about half of it. But you get the idea. This was a feature article, too... a real barn burner.

No punctuation or spaces? (0, Troll)

Pentagram (40862) | more than 10 years ago | (#8092239)

I think you mean that it would have been more readable to Perl users if it had been written in punctuation and spaces.

Re:No punctuation or spaces? (0, Offtopic)

mph (7675) | more than 10 years ago | (#8093957)

Welcome to Slashdot, where a little good-natured ribbing gets you moderated down as a "Troll."

I bet these moderators are shocked and offended by a Jay Leno monologue.

Re:No punctuation or spaces? (0, Offtopic)

mondoterrifico (317567) | more than 10 years ago | (#8094979)

How the hell did this comment get moderated troll?!

It's funny!

If it needs to be explained to you, maybe you shouldn't have mod points on slashdot.

Hey Editors! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8091972)

Your blackboard should look like this by the end of the day:

I will remember my closing tags, especially </I>.
I will remember my closing tags, especially </I>.
I will remember my closing tags, especially </I>. ...

Perl's motto should be (0)

Anonymous Coward | more than 10 years ago | (#8092007)

"Write-Only"

Perl is dying (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8092017)

God I'm bored today. What is it with Mondays?

Re:Perl is dying (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8092049)

God I'm bored today. What is it with Mondays?

They're whack.

Easy ways to get admin rights on NT servers! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8092075)

Easy ways to get admin rights on NT servers!

I have recently found a really easy way to get Admin rights on an NT

box....

so easy I'm surprised it wasn't discovered earlier.

Here we go:

A plain old user has write access to the winnt\system32 directory.

He renames logon.scr to logon.old.

He then renames usrmgr.exe (or musrmgr.exe on Workstations) to logon.scr.

He then shuts down the computer using the "close all programs and log on as

different user" option.

He then waits.....

The system will start logon.scr if left long enough.

User Manager will load......

The user then selects his domain. (You have to type the domain name in)

He then adds himself to the Administrators group.

He then exits and logs back on.

Re:Easy ways to get admin rights on NT servers! (0)

Anonymous Coward | more than 10 years ago | (#8092374)

Doesn't this presuppose that the administrator of the box didn't properly secure logon.scr so that it can be overwritten with usrmgr.exe?

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.

my review of honestpuck (-1, Troll)

Anonymous Coward | more than 10 years ago | (#8092078)

he's a tool.

Editors assume they are better than mods. (0, Offtopic)

jared_hanson (514797) | more than 10 years ago | (#8092125)

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.

CITE (0, Offtopic)

MagicM (85041) | more than 10 years ago | (#8092215)

FYI: The close-tag for <CITE> is not optional.

in a way (-1)

p-unit*or*die (729031) | more than 10 years ago | (#8092305)

who wants to touch me? anyone? anyone at all? i made love to the linux penguin and we are going to have penguinpeoplebabies. if my head were a pineapple, i would donate it to charity. let us all take time to stomp some romp. damn spacebar.

best of the perl journal? (0, Troll)

Savatte (111615) | more than 10 years ago | (#8092307)

Is it blank? ;)

Welcome to the New Reich! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#8092347)

[com.com]
Howard Dean's 'smart ID' plan


By Declan McCullagh
CNET News.com
January 26, 2004, 5:18 AM PT

COMMENTARY--After Howard Dean's unexpected defeat last week in Iowa, public attention has focused on his temper, his character, and that guttural Tyrannosaurus bellow of his not-quite-a-concession speech. But Dean's views on Americans' privacy rights may be a superior test of his fitness to be president.
Dean's current stand on privacy appears to leave little wiggle room: His campaign platform pledges unwavering support for "the constitutional principles of equality, liberty and privacy."

Fifteen months before Dean said he would seek the presidency, however, the former Vermont governor spoke at a conference in Pittsburgh co-sponsored by smart-card firm Wave Systems where he called for state drivers' licenses to be transformed into a kind of standardized national ID card for Americans. Embedding smart cards into uniform IDs was necessary to thwart "cyberterrorism" and identity theft, Dean claimed. "We must move to smarter license cards that carry secure digital information that can be universally read at vital checkpoints," Dean said in March 2002, according to a copy of his prepared remarks. "Issuing such a card would have little effect on the privacy of Americans."

Dean also suggested that computer makers such as Apple Computer, Dell, Gateway and Sony should be required to include an ID card reader in PCs--and Americans would have to insert their uniform IDs into the reader before they could log on. "One state's smart-card driver's license must be identifiable by another state's card reader," Dean said. "It must also be easily commercialized by the private sector and included in all PCs over time--making the Internet safer and more secure."

The presidential hopeful offered few details about his radical proposal. "On the Internet, this card will confirm all the information required to gain access to a state (government) network--while also barring anyone who isn't legal age from entering an adult chat room, making the Internet safer for our children, or prevent adults from entering a children's chat room and preying on our kids...Many new computer systems are being created with card reader technology. Older computers can add this feature for very little money," Dean said.

There's probably a good reason why Dean spoke so vaguely: It's unclear how such a system would work in practice. Must Internet cafes include uniform ID card readers on public computers? Would existing computers have to be retrofitted? Would tourists be prohibited from bringing laptops unless they sported uniform ID readers? What about Unix shell accounts? How did a politician who is said to be Internet-savvy concoct this scheme?

Perhaps most importantly, does Dean still want to forcibly implant all of our computers with uniform ID readers?

Unfortunately, Dean's presidential campaign won't answer any of those questions. I've tried six times since Jan. 16 to get a response, and all the press office will say is they've "forwarded it on to our policy folks." And the policy shop isn't talking.

Then there are the privacy questions. To curry favor among the progressive types who form the backbone of his campaign, Dean has positioned himself as a left-of-center civil libertarian. He's guest-blogged for progressive doyen Larry Lessig, embraced the Brady Bill and affirmative action, told audiences on the campaign trail that the Bush administration has "compromised our freedoms in the name of fighting terrorism," and pledged to repeal parts of the USA Patriot Act.

It's difficult to reconcile Dean's current statements with his recent support--less than two years ago--for what amounts to a national ID card and a likely reduction in Americans' privacy. "Privacy is the new urban myth," Dean said in that March 2002 speech.

"I know of no other Democratic candidate who has this view on national ID," said Chris Hoofnagle, associate director of the Electronic Privacy Information Center. "I hope that he'd reconsider his policy on national ID because it has significant affects on individuals' right to privacy and does not make the country more secure. If you think about it, the implication is that children would have to be issued cards as well. Are we talking about ID cards from birth?"

Dean's March 2002 speech to a workshop at Carnegie Mellon University--given just six months after the Sept. 11, 2001, terrorist attacks--was designed to throw his support behind a standard ID proposal backed by the American Association of Motor Vehicle Administrators (AAMVA). At the time, Dean was chairman of the National Governors Association, a key ally for the AAMVA as it lobbied to transform the humble state driver's license into a uniform national ID card.

"I'm not surprised," said Barry Steinhardt, director of the technology and liberty program at the American Civil Liberties Union and a former Vermont resident. "It's a backdoor national ID. It won't even work to protect against terrorism because we know that some of the 9-11 terrorists had phony driver's licenses that they were able to buy on the black market."

It's true that most American adults already carry around driver's licenses. But the AAMVA proposal would have mandated biometric identifiers such as digitized fingerprints or retinal scans. Depending on how the system was implemented, your license could be equipped with a smart card (which Dean suggested) that could store information about your movements whenever it was swiped in a reader. It could also be tied to a back-end database so all verifications would be logged with the time, date and location.

The idea never gained traction in Congress because of privacy concerns and opposition not only from conservative activists, but from Democratic-leaning groups including People for the American Way, National Consumers League, and National Council of La Raza.

One prominent group that did support a standardized ID at the time is the New Democrats' public policy wing, which has suggested that microchip-implanted smart cards could hold not only retinal scans or fingerprints but also "food stamps, voter registration, library cards, hunting and fishing licenses" and a wealth of corporate data like E-Z-Pass, gas station automatic billing, and banking information. In one of history's ironic flourishes, Dean lashed out at the New Democrats last month in Exeter, N.H., dubbing them "the Republican wing of the Democratic Party."

It's possible that Dean has a good explanation for his uniform ID card views, and can account for how his principles apparently changed so radically over the course of just two years. Perhaps he can't. But a refusal to answer difficult questions is not an attractive quality in a man who would be president.

biography
Declan McCullagh is CNET News.com's Washington, D.C., correspondent. He chronicles the busy intersection between technology and politics. Before that, he worked for several years as Washington bureau chief for Wired News. He has also worked as a reporter for The Netly News, Time magazine and HotWired.

Proof that Howard Dean is Hitler reincarnate!

When is Perl 6 going to be released? (0)

Anonymous Coward | more than 10 years ago | (#8092686)

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.

poster-sized cover prints? (1)

otis wildflower (4889) | more than 10 years ago | (#8095147)

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 think I will get it (1)

NightLamp (556303) | more than 10 years ago | (#8096056)

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.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?
or Connect with...

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>