Domain: perldoc.com
Stories and comments across the archive that link to perldoc.com.
Comments · 97
-
CGI programs
I first learn Perl with the aim of creating dynamics webpages. I learnt from the tutorial Picking Up Perl - this is great and taught my most I needed to know with regard to the language - but it didn't teach me how to use it for websites.
I picked up from code lying about how to read and write files, get post/get data, and so forth, and slowly built up into quite a good Perl programmer (I suppose. Not amazing, but quite fluent). This wasn't easy though and was slow. Why? I never got taught, all in one place, how to do that. I think this is what this book is trying to do - but with a much wider range than just CGI programs (although it doesn't seem to neglect it, either).
I tried to write my own tutorial for using Perl in webpages to try and help. I'm not going to link to it here though, because it is quite terrible (I was 14 when I wrote it).
After learning Perl, and being able to use it, there is always using the standard librarys. For this, PerlDoc has been so helpful to me. -
Re:here's mine
It was a joke, but you can see other "weird HTML" examples here.
-
Re:Head Start?
I couldn't agree more about PHP, and how often are the user comments completely wrong, or suggest something that's going to get your site owned.
As for perl documentation its not that hard. On *nix 'man perl' gives a list of man pages and what to look for where. And if you're looking for a specific function you can do 'perldoc -f ' and get a good idea how to use it. Or do perldoc perlfunc (or man perlfunc) to get a complete function list if you aren't sure what to look for. And most pagers let you search the page your viewing.
If you don't have access to a shell there's also http://perldoc.com/ which should have everything that's availiable from a shell. And finally if you need info on specific modules it can be obtained from the shell after installed (at least through CPAN) or you can view the docs on the web by typing in the module name at http://search.cpan.org/
if you still need help there's also http://perlmonks.org/ with lots of people ready to answer your questions :) -
Re:Language agnosticism needs to be preached more.
Perl is not an acronym; There is no such thing as "PERL." It's either "Perl," or "perl," depending on whether you're referring to the language or the implementation/interpreter.
:-)
See: http://www.perldoc.com/perl5.8.4/pod/perlfaq1.html #What's-the-difference-between--perl--and--Perl-- -
Re:Apache Benchmark is your friend
Yes, it's a great tool for relatively static sites. For dynamic ones, I'll generally whip together something with HttpUnit or LWP so that I can simulate a user going through a dynamic, multi-step process. They do require more horsepower to generate high load, but accurate user behavior simulation gives you a lot more confidence that your app won't fall over when the hordes come.
-
Re:PHP - poor designActually, a careful reading of my post shows that being able to do it in PHP is not logically necessary to my point
:-) But it is good that PHP can do that, although passing the function by name is another smell.... hmm, let me see... oh, poor scoping ability, which limits the ability (no relevant hits on PHP closure) to use closures (link to a Perl FAQ because it's the best resource I found in 30 seconds; Python, Javascript, and a wide variety of other languages use them). Fortunately, that's not so killer now that PHP has at least some OO support. (You can usually use support for closures or classes to hack enough support for the other to get by.)
As for "bad variable names", note that in Perl, $a and $b in the sort function are actually mandated by the language... well, sort of, kind of, close enough; "man perlfunc" and look for "sort" for the details. Everything else is a free choice, and short examples call for short names. I guarantee you I haven't written "array" as a variable in many, many years, unless that was absolutely the best name. (And for things like sorting functions, it sometimes is.)
Indentation is via "ecode":an ecode block
although it still apparently is a bit kooky, as you can see.
four spaces of indentation
eight spaces of indentation
no more -
What's Wrong with PerlThere is no excuse for Perl being so badly designed, nor for Perl programmers refusing to admit and trying to cover up its flaws.
If you're a Perl programmer who doesn't know what Perl's weaknesses are yourself, and you have to ask me to spell them out for you, then you're an Incompetent Perl Programmer. You should have done that research yourself before deciding to use Perl. Shame on you! Put down the crack pipe and step away from the keyboard.
Incompetent Perl programmers who can't see or admit the flaws in their language are like the illegitimate president George W Bush who is out of touch with the harsh reality of Iraq and the economy, and therefore incapable of solving the problems. Incompetent Perl Programmers and Illegitimate US Presidents need to face the reality before they're qualified to solve the problems.
Aaron Weiss said: It's not a secret that Perl is structurally flexible, and the conventional wisdom is that Perl gives you "enough rope to hang yourself". Funny. But that's not the gripe -- go ahead, hang yourself if you want. That's freedom. The problem is that Perl also gives you enough rope to hang others."
Eric Naggum said: It's not that perl programmers are idiots, it's that the language rewards idiotic behavior in a way that no other language or tool has ever done.
Peter da Silva said: The syntax is awkward, overcomplex, has too many obscure special cases (there's to many obvious examples to list, I'll just mention one of the obscure ones: the way scalars and collections in for loops are treated), and the result is that you have to not just "know Perl" you have to be a Perl language lawyer just to avoid wandering into a dark alley and getting figuratively mugged by some cool feature.
Nicholas Clark said: That indirect object syntax is worthy of hate. (I think)
In the Switch documentation, Damian Conway said: BUGS: There are undoubtedly serious bugs lurking somewhere in code this funky
:-) Bug reports and other feedback are most welcome. LIMITATIONS: Due to the heuristic nature of Switch.pm's source parsing, the presence of regexes specified with raw ?...? delimiters may cause mysterious errors. The workaround is to use m?...? instead. Due to the way source filters work in Perl, you can't use Switch inside an string eval.Matt McLeod said: But the moment you try to anything properly, try to modularize and, you know, do perverted things like *reusing code*, it becomes a pain in the arse. One exciting feature I came across recently is that under certain circumstances you can create what seems like a module which exports a bunch of names, but if you don't start the name with an upper-case character it only exports the first. And it won't *tell* you this is what is going on (even with -w and use strict), it just whines that it can't find &main::foo() when it's supposed to be getting &thing::foo(). Don't even get me started on the flatten-all-arguments-into- a-list-of-scalars bullshit. Or the lack of any decent support in the basic language for datastructures other than lists. I'm sorry, walking through an array of arrays of hashrefs is not a substitute for a record/struct datatype, and having to fight it's alleged OO model to use a third-party "class" do what would be a simple job in anything else is completely not acceptable to me.
Lars Marius Garshol said: Casting of operands in comparisons: induced errors. Redefinition of some C keywords: walltrap. Overcomplexity 1: suffix condit
-
Re:What is Rexx?It has no pointers or references (ala Perl).
-
Re:Obfuscation
-
Re:PERL programs are hard to distribute
I know Larry. It's Perl. See perlfaq1.
First off, I never said it was 'PERL'
;) I think a grandparent did that.
Second, I took your advice and checked perlfaq1.All from perldoc.com:
Regarding PERL (this link is perlfaq1, btw) - But never write "PERL", because perl is not an acronym, apocryphal folklore and post-facto expansions notwithstanding.
Regarding "Practical Extraction and Report Language" - The title given to perl in this page. Also, check the rest of the perldoc.com site
Regarding "Pathologically Eclectic Rubbish Lister" - Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.
Taking into account the man's humor and wit, it's safe to call it whatever you want, as long as you don't take anything too seriously
:) -
Re:PERL programs are hard to distribute
I know Larry. It's Perl. See perlfaq1.
First off, I never said it was 'PERL'
;) I think a grandparent did that.
Second, I took your advice and checked perlfaq1.All from perldoc.com:
Regarding PERL (this link is perlfaq1, btw) - But never write "PERL", because perl is not an acronym, apocryphal folklore and post-facto expansions notwithstanding.
Regarding "Practical Extraction and Report Language" - The title given to perl in this page. Also, check the rest of the perldoc.com site
Regarding "Pathologically Eclectic Rubbish Lister" - Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.
Taking into account the man's humor and wit, it's safe to call it whatever you want, as long as you don't take anything too seriously
:) -
Re:PERL programs are hard to distribute
I know Larry. It's Perl. See perlfaq1.
First off, I never said it was 'PERL'
;) I think a grandparent did that.
Second, I took your advice and checked perlfaq1.All from perldoc.com:
Regarding PERL (this link is perlfaq1, btw) - But never write "PERL", because perl is not an acronym, apocryphal folklore and post-facto expansions notwithstanding.
Regarding "Practical Extraction and Report Language" - The title given to perl in this page. Also, check the rest of the perldoc.com site
Regarding "Pathologically Eclectic Rubbish Lister" - Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.
Taking into account the man's humor and wit, it's safe to call it whatever you want, as long as you don't take anything too seriously
:) -
Re:PERL programs are hard to distribute
I know Larry. It's Perl. See perlfaq1.
First off, I never said it was 'PERL'
;) I think a grandparent did that.
Second, I took your advice and checked perlfaq1.All from perldoc.com:
Regarding PERL (this link is perlfaq1, btw) - But never write "PERL", because perl is not an acronym, apocryphal folklore and post-facto expansions notwithstanding.
Regarding "Practical Extraction and Report Language" - The title given to perl in this page. Also, check the rest of the perldoc.com site
Regarding "Pathologically Eclectic Rubbish Lister" - Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.
Taking into account the man's humor and wit, it's safe to call it whatever you want, as long as you don't take anything too seriously
:) -
My Top Ten Tools
-
Re:PHPIt might just be easier for them to move to Perl. Perl is PHP's older (and more experienced) sibling.
Here are 1 and 2 written in short form in Perl:
1) Populate an array with values 1 - 10 cubed.
Perl:
$b[$_] = $_**3 for 1..10;
2) Build an array that holds sub arrays
Perl
@a = (qw(a b c), qw(d e f), qw(g h i));
qw significantly cuts down on the typing time, as you don't have to put in quotes or commas between items.
if you need variable interpolation mixed in, you have to do it the long way, though:
@a = (['a',$b,'c'], [$d,'e',$f], ['g',$h,'i']);
Although () may work for the inner declaration, the perl "Manipulating Arrays of Arrays in Perl" (perldoc perllol) page recommends using () for the outer array and [] for the inner arrays.
-
Re:Good!
I find there are a lot of books and resources which each Perl, or teach SQL, but don't teach you how to use Perl, or use SQL.
For example, it is perfectly possible to read a book, learn Perl, and not be able to actually use it for anything useful (in regard to websites). Not many books that I've seen have addresses this. My personal knowledge of Perl for use in webpages is scraped together.
Perldoc.com helps a lot, however. Books like this seem useful as a starting ground.
PHP is gaining a lot of ground on PHP (It's overtaken it, I hear). This may be because it is more suited to suited to web development, or it may be more because all it does is web development: As soon as you know PHP, you know how to make a website using PHP.
Most Slashdot readers will be past this point in learning a language I should imagine, so, without reading anymore than this book review, I might suggest it wouldn't be worth buying, but this is certainly the sort of book which should be on the bookselves in shops. A lot more helpful than 101 books about how to use IOSTREAMs in C++.
(This is a repost with correct HTML... why didn't I pressed Preview? :D) -
Good!
I find there are a lot of books and resources which each Perl, or teach SQL, but don't teach you how to use Perl, or use SQL. For example, it is perfectly possible to read a book, learn Perl, and not be able to actually use it for anything useful (in regard to websites). Not many books that I've seen have addresses this. My personal knowledge of Perl for use in webpages is scraped together. Perldoc.com helps a lot, however. Books like this seem useful as a starting ground. PHP is gaining a lot of ground on PHP (It's overtaken it, I hear). This may be because it is more suited to suited to web development, or it may be more because all it does is web development: As soon as you know PHP, you know how to make a website using PHP. Most Slashdot readers will be past this point in learning a language I should imagine, so, without reading anymore than this book review, I might suggest it wouldn't be worth buying, but this is certainly the sort of book which should be on the bookselves in shops. A lot more helpful than 101 books about how to use IOSTREAMs in C++.
-
Re:It's too bad
I realized the potential and suitability of what I called "hashing databases" for web content and much simple content.
Actually, there was a time when you didn't call something a database unless it had some serious data-management function. ISAM files weren't considered databases, just files that supported non-sequential access. Over the years, the term has been applied to just about everything that has any features of a DBMS. The most extreme case was Ashton-Tate's old FrameWork product, which included a "database" that was nothing but a specialized spreadsheet. And it had to fit in DOS memory, so your "database" couldn't be more than 500K!In retrospect, Perl hackers love hashes and I think they use them in a similar way to BDB.
Not similar, exactly the same. Perl treats a BDB file as a kind of hash. -
Manipulating Arrays of Arrays in Perl
I haven't been following perl 6 too closely, is there any word on if Perl will be getting rid of the multi dimensional array hack of having to use references? This is something that dates back to Perl 4. It could have been fixed in Perl 5 but was the whole references thing was introduced for backwards compatability. But so much is changing in Perl 6 anyway it would be nice to be able to do things like @array[6][4][2][5][6] = "whoa!"
See perldoc perllol: Manipulating Arrays of Arrays in Perl.
-
Re:Too obscure
I think you are confusing anonymous code blocks with closures. The map and sort functions can take an anonymous code block, but they aren't creating closures.
It is a closure if, when it executes, it refers to my variables that were in a visible scope at the time that it was defined. You might want to re-read Function Template from the perlref man page to become a little clearer on the subject.
The sort function doesn't use a closure, it created two new global called $a and $b. The map function doesn't use globals either, it redefines $_.
With this kind of error of understanding, it takes away from the rest of your posting.
-
Re:Release date: 2020
-
Re:Perl...
No, I mean like:
Doc
Something a little more thorough.
http://www.perldoc.com/
Unit Testing
Not just wrappers, but something a little more thorough and mature like say from executable to module.
Unit Testing
Library Repository
http://raa.ruby-lang.org/
..pales in comparison to...
http://www.cpan.org/
Portability
[Acorn] [AIX] [Amiga] [Apple] [Atari] [AtheOS] [BeOS] [BSD] [BSD/OS] [Coherent] [Compaq] [Concurrent] [Cygwin] [DG/UX] [Digital] [DEC OSF/1] [Digital UNIX] [DYNIX/ptx] [EMC] [Embedix] [EPOC] [FreeBSD] [Fujitsu-Siemens] [Guardian] [HP] [HP-UX] [IBM] [IRIX] [Japanese] [JPerl] [Linux] [LynxOS] [Macintosh] [Mac OS] [Mac OS X] [MachTen] [Minix] [MinGW] [MiNT] [MPE/iX] [MS-DOS] [MVS] [NetBSD] [NetWare] [NEWS-OS] [NextStep] [Novell] [NonStop] [NonStop-UX] [OpenBSD] [ODT] [OpenVMS] [Open UNIX] [OS/2] [OS/390] [OS/400] [OSF/1] [OSR] [Plan 9] [Pocket PC] [PowerMAX] [Psion] [QNX] [Reliant UNIX] [RISCOS] [SCO] [Sequent] [SGI] [Sharp] [Siemens] [SINIX] [Solaris] [SONY] [Sun] [Symbian] [Stratus] [Tandem] [Tru64] [Ultrix] [UNIX] [U/WIN] [Unixware] [VMS] [VOS] [Win32] [WinCE] [Windows 3.1] [Windows 95/98/Me/NT/2000/XP] [z/OS]
User Community
A little more world wide and established.
http://www.pm.org/ ...in addition to the mailing lists.
So, what were you on about again?
From the parent parent parent poster. "Ruby has almost all of the power of Perl, with none of the ugliness" isn't quite a fair statement, considering Ruby is lacking or behind on almost everything else Perl is superior at. Ruby is still playing catch up, and depending on who you ask, can also be considered ugly.
-
Re:Slashdotted. Here's the text
Can anybody fill us in on the joke?
TFM can.
-
Re:At long last...
For non-perl geeks like me (from here):
Most tasks only require a small subset of the Perl language. One of the guiding mottos for Perl development is "there's more than one way to do it" (TMTOWTDI, sometimes pronounced "tim toady"). Perl's learning curve is therefore shallow (easy to learn) and long (there's a whole lot you can do if you really want). -
Re:Be sure to get LWP & Perl
Or, if you have minimal working knowledge of objects and modules, you can just read the lwpcook manpage. Yeah the O'Reilly LWP book goes into a little more, but look those modules up on search.cpan.org too, and buy the spidering book instead because it goes so much further.
-
Perl CGI coders
Take note of escapeHTML() in the CGI module. Use that on the form input that you save into a database, and that should cut down on most of the XSS problem. It's quite humiliating for a webmaster to have a guestbook get trashed by a load of img tags and evil links to offending sites (although I see a lot of Slashdotters abusing the the URL feature this way).
--
hecubas -
Re:On Perl and command-line utilitiesTo be useful, numutils should go beyond what is trivially available in perl and awk. That might involve using C, or just a sufficiently complex script. I don't think numutils is sufficiently complex enough as it is now to be distributed. The issue is whether it fills a particular void, and how well it meets that need. The random utility is useless as written. To generate a random number why not just read the perldoc on srand?
Suso Banderas should follow up on this goal to implement the ability to simultaneously operate on columns of data.
A month ago, I wrote an awk script which calculates mean, standard deviation, variance, min, max, sum, and count (see below) for a given stream of numbers.
#!/bin/nawk
$1 ~ /[0-9]+/ { x = $1; N = N+1;
if (N>1) { if (min>x) {min=x}; if (x>max) {max=x}; sumx = x + sumx; oldavgx = avgx;
avgx = avgx + (x-avgx)/N; varx = (N-2)/(N-1)*varx + N(avgx - oldavgx)^2; }
else { min = x; max = x; sumx = x; avgx = x; varx = 0; }
} END { print avgx,sqrt(varx),varx,min,max,sumx,N }
This took me very little time to write, and it covers half of numutils scope of effort. The numutils package should shift focus away from calculating means and bounds.
This is my suggestion: For each utility, determine what numutils does which is a pain to accomplish in awk or perl. Focus on those areas.
Some of these scripts are excellent examples of what can be accomplished in Perl, though. And better commented than most.
Personally, i'm interested in finding something that would compute the median and percentiles for a given stream of input data. I was excited to see "numutils" but was dismayed as not finding the variance. I would like to see an open source version of something like the NAG utilities such as nag_summary_stats_1var or nag_5pt_summary_stats.
I guess I'm just waiting for the the Commons-Math Jakarta Mathematics Library project to get released.
-
Re:Let's wish this project good luck
This is covered in the Perl FAQ.
How can I hide the source for my Perl program?
There is no way to do what you want. Any reasonable Perl programmer can undo Stunnix obfuscation in minutes. All that's left is the strange variable names.
By all means use it if you want. But don't expect it to give you any protection from people reading your source code.
-
Re:Here's my challenge...Does anyone here know how to do multi-line regexes in perl?
Um, RTFM? There are plenty of examples of the extended multi-line form in the standard docs and it works just fine.
Simple answer, use the "/x" modifier at the end of your expression to set extended mode. In this mode, whitespace is ignored (unless escaped) within the regex and you can insert comments.
-
Re:YES!!!
-
The man knows his html...
Come on, the timecube guy is obviously a master at modern UI deign and html layout.
:-)
Seriously though, here are some sites whose design I like:
Sweetcode
Mathworld
openrbl.org
perldoc
Paul Borke's website
the Joel On Software forums
the Tech Report (a debatable choice, but the best of its type)
Dmitry's Design Lab
-
Re:Reactionary languages - Perl
You appear to have misspelt "warnings" as "Safe". There's no point using Safe unless you're doing stuff that needs it.
These days, you should be using 'our' rather than 'use vars'. Plus, you say to avoid globals, but you 'use vars'?
You should learn Perl rather than rely on English.
You should not use Java like variable and function names, except where it matches with perlstyle.
As with most languages, the best way to understand code written in the language is to learn the language. Make use of its features and its strengths. Get involved in the community. Read books, read articles and more articles. Contribute to code repositories. etc. -
Oh, indeed there is.
Not that this is on topic by any means, but here is a response.
Of the established solutions for compiling Perl into executables, at the forefront are IndigoStar's Perl2EXE and ActiveState's PerlApp. Both are commercial products. I've not had a reasonable impetus to buy either, but programs like AmphetaDesk, an RSS aggregator written in Perl, make impressive use of Perl2EXE. There may be a point in the future at which I might happily buy it--it just depends on the end I'm trying to meet with a given project. Sometimes preaching the freedom-of-software concept makes us forget that things can be worth money...
There's also perlcc, which comes standard with Perl, but it's in a "very experimental" stage and not recommended for production code.
So, there are options.
Of course, you aren't being a zealot by mentioning the advantages of one language over another. I've enjoyed reading all of the (reasonable) point/counterpoint comparisons between Python and Perl. I personally don't do enough programming in any of the areas where Python surpasses Perl's usefulness to make a serious switch. Perhaps in the future, I will.
What doesn't make sense is one's assumption that because he writes code in one language instead of another he is somehow of a superior race of beings. If there's any measure of superiority to be had, it more appropriately belongs to those who are familiar with (or even those who are willing to learn) more languages and environments and all of the necessary tricks and idioms to write an intelligent solution within any one of them.
But even if this is something that properly defines one's superiority, making a nuisance of oneself screaming about said superiority does an incredible lot to negate it.
Generic segue, an article about the BOFH becoming passé caught my eye today...
-
Re:Remember what 'Perl stands for?
Remember what Perl stands for?
Actually, it doesn't stand for anything. Perl is not an acronym. See the last sentence of the this frequently asked question from perlfaq1. -
Re:Self-documenting subs?
Here are the directions on how to use perl's POD in-comment documentation format that the previous poster mentioned. POD can indeed be either read back in a Manpage-like CLI client, or used to create very nice looking webpages. In fact, it appears the URL i just linked was created in POD.
-
Re:perldocs already far beyond php.net docs
While perldoc (especially perldoc -f functionname) is keen, for those of us who like scroll bars, proportionally spaced fonts, and links, check out perldoc.com. It has documentation for multiple versions and a solid search engine. It also documents almost everything in the insanely useful CPAN.
-
Re:PSST
no Perl interpreters exist
well ... -
Re:Seconded
Perl is not an acronym. See the last sentence of the perlfaq1 question: What's the difference between perl and Perl?
-
Seconded
Maybe I won't get invited to the PERL hacker parties any more, but I have to agree. PERL 5's hacks for object oriented programming have always seemed unnecessarily complicated and ugly, and I don't see things getting any better in PERL 6.
I too looked at Python. Like you, I decided that basing your language's syntax on differing amounts of whitespace was a really, really bad idea, not because it's ugly, but because I have enough trouble keeping tab damage under control on a single platform.
So I'm looking at Ruby. In fact, the only thing stopping me ditching PERL for Ruby tomorrow is lack of time for re-learning, given all the other new stuff I'm learning right now (J2EE, Objective-C, Cocoa, OpenGL, ...) -
Re:balanced parens: NO YOU CAN'TThis faq entry is a bit outdated. There is experimental extended regexp syntax which allows to match balanced expressions. There is even an example in perlre (look for documentation on (??{ code }) syntax construct).
Also there exist CPAN module Text::Balanced which does balanced expressions matching.
-
balanced parens: NO YOU CAN'T
here
Can I use Perl regular expressions to match balanced text? toc
Although Perl regular expressions are more powerful than "mathematical" regular expressions, because they feature conveniences like backreferences (\1 and its ilk), they still aren't powerful enough -- with the possible exception of bizarre and experimental features in the development-track releases of Perl. You still need to use non-regex techniques to parse balanced text, such as the text enclosed between matching parentheses or braces, for example.
An elaborate subroutine (for 7-bit ASCII only) to pull out balanced and possibly nested single chars, like ` and ', { and }, or ( and ) can be found in http://www.perl.com/CPAN/authors/id/TOMC/scripts/p ull_quotes.gz .
The C::Scan module from CPAN contains such subs for internal usage, but they are undocumented. -
Re:Fonts That Don't Suck!Hello Nitpick, PERL still is and always has been an abbreviation of "Practical Extraction and Reporting Language"
Um, no it isn't. Right from the FAQ:
What's the difference between "perl" and "Perl"?
One bit. Oh, you weren't talking ASCII?
:-) Larry now uses "Perl" to signify the language proper and "perl" the implementation of it, i.e. the current interpreter. Hence Tom's quip that "Nothing but perl can parse Perl." You may or may not choose to follow this usage. For example, parallelism means "awk and perl" and "Python and Perl" look OK, while "awk and Perl" and "Python and perl" do not. But never write "PERL", because perl is not an acronym, apocryphal folklore and post-facto expansions notwithstanding. -
Re:Multi-Line Comments
You can use POD for multi-line comments.
-
Compiling?I know most
/. members won't really consider this a problem, but in my opinion it's one of the major problems that is holding Perl back.Very high level languages like Perl are far easier to program in than lower level languages like C and C++. No worries about memory allocation, array sizes, easy string manipluation and so on...
But of all the software currently running on your desktop, probably none of it is written in Perl. Why? Because Perl cannot be truly compiled. Sure, using perlcc I can convert a Perl program to C, but this is still experimental and doesn't really work well. Systems like Perl2Exe and Activestate's Perl Dev Kit that package the perl compiler and program into an executable are an improvement, but the resulting executables are large and have a high start-up time.
I'm sure there will be some people who don't consider this problem: i.e. leave Perl on the server-side and for general sysadmin tasks, as C and C++ have already got the desktop sewn up, but just think how much easier and faster it would be to develop a program like a GUI FTP client in Perl.
If there was a true Perl compiler, Perl could easily become the language of choice for many if not all GUI applications. Currently the only end-user targeted GUI app I have seen written in Perl is UploadAway--and even this is hardly aimed at a mainstream audience.
-
Garbage collection
As others have pointed out, Perl's garbage collector does lend itself to the circle of garbage problem because it uses reference counting. Could you comment on the tradeoffs weighed when designing the garbage collector? e.g., Efficiency, time to implement, etc. If you could, would you reimplement it so that it used techniques like the Train Algorithm instead?
-
Re:Concurrent/Distributed tasksFirst up, have you seen the thread support in Perl 5.8.0? It's documented here if you want to look at it. Exactly what do you think is wrong with it? It's in the core. It's stable. I'm not goading, I just want to know what you think is missing.
Secondly, what's wrong with SOAP? SOAP::Lite works really well and is darn simple to use. Is it too slow? What's your main critisms of it? Other object Persistance frameworks exist (which are in turn used to do distributed transferal of objects. One I'm currently looking at is Pixie which attempts to semitransparently seralise data structures and objects to and from memory and a database (i.e. it's an OODB) (it essentailly works the same way Java does - it does most of it nativly but you can put hooks in if you want)
Do you really think all of this should be in the core? What is core anyway? Since it's often as simple as "perl -MCPAN -e 'install module::name'", how much do you want to force to be shipped with every single copy of perl?
-
Re:skimmed the article
By the way, it's "Perl," not "PERL.". The language is "Perl," the interpreter (the actual program itself) is "perl." Perl is not really an acronym (that was made up after the fact), so "PERL" is not correct.
-
Re:This book fills a niche
It's actually not that often that I want to grep web pages with Perl, the slightly-more difficult stuff is when you want to pass cookies, etc, and that's where I always find the docs to be wanting.
I've always found the libwww-perl cookbook to be an invaluable reference. It covers cookies and https connections. Of course, it doesn't go into too much detail, but it provides you with good working examples. -
Re:Amusing
If you were adept enough to read that, surely you were clever enough to notice it's never PERL within the text of the man page. You might even have noticed a link to perlfaq1, which explains the joke.
I've personally noticed people who write PERL have a strong tendency to write awful code.
-
perldoc.com
Also see perldoc.com