Domain: perl.org
Stories and comments across the archive that link to perl.org.
Comments · 847
-
What an idiotic idea.
Someone already explained this better than I could.
-
Re:Example: Scripting Languages
Perl has excellent support for building threaded applications. See http://perldoc.perl.org/threads.html . I code multi-threaded apps in perl all the time and they utilize my quad-code very efficiently - in fact, my biggest hassle with multithreading is keeping the CPU cooled! There's also a threads::shared module (http://perldoc.perl.org/threads/shared.html) for handling locks, etc. I'd be hard pressed to imagine better language support for threading. Hardware, operating systems, and a lot of languages support threading. Granted, it isn't always easy/possible/worth it, but as things currently stand, the only bottleneck is programmers who are too lazy to design their algorithms for parallel execution.
-
The original Parrot was an April Fool's jokeThe original Slashdot article from almost 8 years ago: Perl + Python = Parrot.
It included a mock press release: Perl and Python Announce Joint Development.
And a joint "interview" of Larry and Guido.
O'Reilly Media even tossed in a bogus book announcement: Programming Parrot in a Nutshell.
A few days later, O'Reilly published The Story Behind the Parrot Prank.
The name was eventually adopted by this project.
-
Re:What?
A Mac is a genuine Unix workstation that is much easier to administer, and has much better software and hardware support than Linux.
Apart from if you want to run the most popular scripting language.
Yeah, you would never have such problems using HP UX or Solaris. Okay, but you won't have problems runnig RedHat
-
Re:Why does this "break" anything?Because that's the way things are done in Perl (just search for "io object" on perl.org):
http://www.nntp.perl.org/group/perl.par/2008/11/msg3821.html
I've built the perl binary with pp on HP UX 11.23 & while running the same on another test machine, the build fails with the following error:
IO object version 1.22 does not match bootstrap parameter 1.23 at /opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/DynaLoader.pm line 252. Compilation failed in require at /opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-thread-multi/IO/Handle.pm line 263.http://www.perlmonks.org/?node_id=490413
I ask the assistance of the monks concerning error reports I am getting from some -- but not all -- automated testers at testers.cpan.org.
t/02_bad_constructor..............IO object version 1.21 does not matc +h bootstrap parameter 1.22 at /usr/local/perl-5.8.5/lib/5.8.5/sun4-so +laris-thread-multi/DynaLoader.pm line 253.Add to that the problems with RedHat Linux mentioned in TFA, you don't need Perl for pattern matching.
-
Re:Use CPAN? You deserve to lose
You absolutely need to install the latest perl before you use it - because the perl (or the modules installed with it) installed with your OS is always too old for any particular module you want to install
I've been using perl for about 8 years, and I've never encountered any such problem. For example, I stayed with perl 5.8 for quite a long time before switching to 5.10, and I never had any problem getting CPAN modules to compile.
and even then you have a chance that the module you want is either broken, or depends on a currently broken module.
This isn't a problem with CPAN, it's a problem with the author or maintainer of that module. For instance, I made the mistake of writing an app that depended on Audio::Play and Audio::Data. Then when I switched my desktop machine from BSD to Linux, I found out that I couldn't get it to compile on Linux. I'm a little less naive now. If you check the CPAN bug reporting system, you'll see that there are several important bugs in these modules that are years old, and haven't been fixed. If you look at the reviews on CPAN, you'll see clear signs of trouble. If you go to the parent module's page on cpan, and click on Perl/Platform Version Matrix, you'll see that it fails its test suite on a lot of platforms, on a lot of versions of perl. None of this is a big secret. You just have to do a little bit of homework before you hitch your wagon to a particular CPAN module.
-
Re:Why does this "break" anything?
shouldn't the new version have been named 1.3 or even 2.0?
from the IO.pm changelog:
IO 1.23 -- Sat Mar 25 19:28:28 CST 2006
- Adjust the regression tests to use t/test.pl when $ENV{PERL_CORE} is defined
- Reduce number of calls to getpeername
- Call qualify on format name passed to format_write. Bug reported by Johan Vromans
- Reduce calls to getprotobyname/number. Patch from Gisle Aas
- Remove references to file TEST used in core so appropriate tests are skipped during an install from CPAN
- Add method say to IO::Handle
- Performance improvement for IO::File::open
- Don't warn about a directory being closed in the DESTROY
looks to me like it's mostly bug fixes and optimization, and not a major rewrite (which would more likely warrant a major version change).
-
Perl Data Language
Perl Data Language is quite nice -- it has all the blended hackish glue-code goodness of Perl (which could be a plus or a minus depending on your personal style). CPAN (the big Perl repository) has a lot of free stuff for access to serial, parallel, and USB ports so you can control your equipment and acquire data. PerlXS (built into Perl) gives you nice access to C libraries, and PP (a meta-language that comes with PDL) helps you sidestep a lot of cruft if you have to use a C module to import large volumes of data.
PDL has built-in commands for plotting 2-D stuff via PGPLOT or PLPLOT, and 3-D stuff via GL. I use it for all my publications.
Some prefer NumPy or SciPy, the Python equivalents of PDL, but (IMAO) Python isn't as expressive as Perl, and the external libraries, while extensive, cannot compete with CPAN for completeness or hugeness.
-
PDL (from Perl), GDL (from IDL), NumPy/SciPy
Perl Data Language is my personal favorite for data acquisition and manipulation - it is an extension to Perl that gives you the usual data analysis and plotting goodies, plus a nice mix of access to C code (via XS), access to the huge CPAN trove of modules (via, er, CPAN), GUI-isms (via PerlTK), and serial port / USB port access for instrument control and data acquisition.
It's based on Perl, which can either be a huge plus or a huge minus depending on whether you like Perl.
If you want bondage-and-discipline, you can go with GDL, which is an open-source clone of IDL. GDL's main advantage is that it is a clone of IDL, which has become the dominant language in some sectors of physics. GDL's main disadvantage is that it is a clone of IDL, which is among the more evil, bletcherous, pitfall-laden, wretched buggy cesspits of quasi-language that exist.
Numeric Python is reputed to be good, but it's not nearly as expressive nor as flexible as Perl. Matter of taste, really.
Gnu Octave is a MatLab clone, but does not have access to the huge library of add-on modules that you can buy for MatLab. Still, many modules exist and if you like the syntax you can stick with it.
Another good place to start is the wikipedia comparison of numerical analysis packages.
-
GDL is the open source replacement for IDL
If you've ever wanted something FORTRAN-ish, but with matrices, see GDL.
They're trying to make an open source interpreter that can take IDL scripts directly. Unfortunately, I don't know if it can open up IDL save files, due to various threats from lawyers.
There's also PDL, which deals with large data cubes in Perl.
-
Re:Wishlist
6) eliminate this bafflingly ridiculous notion of "references."
from http://perldoc.perl.org/perlreftut.html :
One of the most important new features in Perl 5 was the capability to manage complicated data structures like multidimensional arrays and nested hashes. To enable these, Perl 5 introduced a feature called `references', and using references is the key to managing complicated, structured data in Perl.
It boggles the mind that I have to go through this nonsense to store an array in an array. Guess what I have to do in order to store an array in an array in ruby...
or rather, guess what I don't have to do in order to store an array in an array in ruby (or probably python as well).
-
Re:But... is Perl now historical only?
Perl 5 is still alive and kicking. For just one example of a new project in Perl 5 on a major site, see the BBC iPlayer web interface. (I've heard rumours that another example is youporn
;)The Perl community is very good at keeping up with the advances of other languages, and in some cases quietly advancing itself. The Moose object system is a good example, which has at least one other language (Javascript) has seen fit to copy.
Moose itself has drawn a lot of inspiration from Perl 6. But Perl 5 has a lot of baggage (as any language of it's age does, e.g. Java), and it'll never be able to do all the things Perl 6 will eventually be capable of.
Perl 6 is a massive undertaking though. They are releasing often, but it's too early to really do much cool stuff with it yet (although you can at least play Hangman). I don't think there's any other language taking on a project so ambitious, at least not one funded by donations, and definitely nothing in the world of dynamic languages.
At any rate, I don't really see how it can be vapourware when they're releasing actual code at least monthly that you can do stuff with.
-
Re:How about gitting CPAN?
They're working on Git/CPAN patching functionality. I imagine that other interesting combinations of the two will be seen in the near future.
-
I know the Perl6 release date! -- leaked info
Larry has announced Perl6 will be released on Christmas day on some year in the near future. I obtained insider information that the release date is Christmas Day 2012, probably with a 3-day early release because so much progress has been made on the Parrot interpreter recently -- for a final release date of Dec 21, 2012. Here are the leaked media files and documents: [link 1] [link 2]. It is finally clear why Larry calls his update posts "Apocalypses". For more info see this link.
-
Re:Christmas?
You are hugely mistaken. http://dev.perl.org/perl6/faq.html
-
Re:Who needs Perl 6 when we have Perl 5?
Take a look at the November 2008 TIOBE index top ten:
Position Position Programming Ratings Delta Nov
Nov 2008 Nov 2007 Language Nov 2008 2007
1 1 Java 20.299% -0.24%
2 2 C 15.276% +1.31%
3 4 C++ 10.357% +1.61%
4 3 (Visual) Basic 9.270% -0.96%
5 5 PHP 8.940% +0.25%
6 7 Python 5.140% +0.91%
7 8 C# 4.026% +0.11%
8 11 Delphi 4.006% +1.55%
9 6 Perl 3.876% -0.86%
10 10 JavaScript 2.925% 0.00%You can read the rest of the article here...
-
Netcraft confirms it
perl is dying http://use.perl.org/~Ovid/journal/38010
-
Re:print function
You seem to want Perl. You can find it at http://www.perl.org/
-
Handy links
While I'm not providing any specific trick per say, on topic are a few useful links:
http://www.regular-expressions.info/ - this one is handy for regex info particularly in Javascript which I use so infrequently I need to know how to match, capture, substitute, etc.
http://perldoc.perl.org/perlre.html - plenty of regex info there which is Perl specific, but of course extends to many other similar implementations -
Re:Will we ever see Parrot?
Thanks mate, you're doing a great job. I downloaded Parrot and gave it a go. Perl6 is looking good. But, Parrot tells me that Larry got one of his perl6 programs wrong. If you look at Apocalypse 12, Larry has this:
class Point {
has $.x;
has $.y is rw;
method clear () { $.x = 0; $.y = 0; }
}Note that x is read-only, and y is read-write. I assume that if you don't put rw after an attribute, it's read-only. Otherwise, there's not much point having rw. Later in the example program, Larry wrote this:
$point.x = -1; # illegal, default is read-only
$point.clear; # reset to 0,0The first line is illegal, because you can't change the read-only value of x. But the second line calls clear(), which tries to change the value of x. At this point, Parrot barfs with: "Cannot assign to readonly variable current instr.: 'parrot;Point;clear' pc 609 (EVAL_13:181)" and then lots more barf. So is this correct? If you make an object attribute which is rw, you can change it either in a method or by calling $object.attrname(42) for example, but if it's not rw, you can't change it ever, even in a method.
Is Apocalypse 12 wrong when it has a method that changes a non-rw attribute? Or is the compiler wrong in not letting the method change the attribute? I think Apocalypse 12 is wrong, because since rw means read-write, the lack of rw should be read-only. And read-only is not the same as private, so a method should not be able to change a read-only attribute.
Anyway, that's the answer to "Will we ever see Parrot?". You can see it right now. Or wait until Tuesday like chromatic says.
The move towards VMs is going to make programming easier. Everybody saw what happened with Java and write once, run anywhere. It didn't quite work out, but it was pretty close. If we can have perl code being compiled into bytecode, that'll give us speed improvements comparable to switching from CGI to mod_perl or FastCGI. Since so many people talk about the speed of running code, that's important.
If the same VM can run code from different languages, that's going to produce some very interesting effects. Why have a language flamewar when the VM can run any language? Instead of endless flaming, we can encourage people to use whichever language they like to write their code, then get the VM to do the dirty work.
In the article, it says that in the future, operating systems might ship with a generic VM that can run code from any language. This is a great idea, when you link it with the idea of high-level-language VMs. The more code you write, the more bugs you get. High level languages let you do the same thing with less code. Less code means less bugs.
Imagine what we can achieve when we have VMs available to run pure functional code, and you link that with the advances in storage technology. Since a pure function returns the same result given the same parameters, we can create something like rainbow tables to cache the function results. This is going to be so much better than calling malloc and free and using pointers.
-
Re:The inevitable Java vs Mono
``It is unfortunate that the mono is so closely associated with Windows, if the mono team had created/implemented a
completely new set of cross-platform libraries (that bore no relation to Microsoft's framework) it would be more accepted.''But then they would just have done what various others have already done, wouldn't they?
-
Re:Goto is good
To say nothing of the gifts of on-going development (if they let you at Perl 5.10 at your workplace).
-
Re:Excellent Post
Here's what I got, so far. Sorry it's not tabbed and cross-referenced...
http://ask.slashdot.org/article.pl?sid=08/09/17/224230 -- in case anyone wants this page, too
http://www.quickref.org/
http://gotapi.com/
http://www.regular-expressions.info/ -- regular expressions
http://www.perlmonks.org/
http://www.rosettacode.org/wiki/Main_Page
http://perldoc.perl.org/
http://www.perlbuzz.com/
http://java.sun.com/reference/
http://forums.sun.com/index.jspa
http://developer.mozilla.org/ -- javascript
http://www.w3.org/MarkUp/Guide/
http://www.w3.org/MarkUp/Guide/Advanced.html
http://www.w3.org/TR/html4/
http://www.w3.org/TR/xhtml1/
http://www.w3.org/Style/Examples/007/
http://www.w3.org/Style/Examples/011/firstcss
http://www.w3.org/Style/CSS/learning
http://en.wikibooks.org/wiki/Programming:Tcl
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
http://cprogramming.com/
http://www.cplusplus.com/
http://cm.bell-labs.com/cm/cs/cbook/
http://www.parashift.com/c++-faq-lite/
http://en.wikibooks.org/
http://developer.apple.com/
http://cocoadev.com/
http://www.cocoabuilder.com/ -
C/C++/Java/Perl/Python references
C
The GNU C Library
http://www.gnu.org/software/libc/manual/C++
Standard Template Library Programmer's Guide
http://www.sgi.com/tech/stl/Boost C++ Libraries
http://www.boost.org/doc/libsJava
Java(TM) Platform, Standard Edition 6 API Specification
http://java.sun.com/javase/6/docs/api/Perl
Perl version 5.10.0 documentation
http://perldoc.perl.org/Python
Python Library Reference
http://docs.python.org/lib/lib.htmlFor learning C and C++, I recommend these books:
Kernighan, Ritchie: The C Programming language
Kernighan, Pike: The Practice Of Programming
Koenig, Moo: Accelerated C++: Practical Programming by Example
Sutter, Alexandrescu: C++ Coding Standards -
Re:Perl and Python
For Perl I always have a copy of Beginning Perl on my hard drive. But it's also always the first hit on Google for beginning perl if you have to change the computer. I know, it's a PDF and it therefore has no cool AJAX Web 2.0ish effects but the function reference is great and whenever I forget how to create an anonymous hash reference and whatnot (which easily happens to me when not programming Perl for a while): it's there.
For PHP I always use php.net. I never searched for something PHP related I couldn't find there. -
Re:Start at CPAN.Perl.org
I'm not so sure about the quality of random perl fragments from google searches.
I found the perlipc docs quite useful - if you're not just writing throwaway scripts you are going to have to handle signals and exceptions.
http://search.cpan.org/~rgarcia/perl-5.10.0/pod/perlipc.pod
Then there's also:
http://faq.perl.org/Some people use the perl cookbook - http://oreilly.com/catalog/9780596003135/
So far I haven't really had need to look at that much.
-
Perl has by far the best docs
The most annoying thing is having to go on the web to find a doc. PHP is horrifying enough and then you read the docs and find all the exceptions to whatever rule (and the bugs) in the comments.
For Perl:
perldoc -f [function name]Or perldoc [Module::Name] (also man Module::Name works on most Linux distros)
Also on Linux, 'man perl' gives a list of a whole ton of man pages that give you specific information on regexes, objects, references, syntax, variables, etc.
And if you have to have it in a pretty web interface it is indeed all online
(module docs are as well)Say what you want about Perl but it has tons of useful modules and it is very well documented.
-
Re:Suggestions for perl
Seconded. You can say whatever you want about Perl, but the online documentation at perl.org is second to none. Manuals, tutorials and references are very well written and organized.
-
Re:Perl and Python
-
Re:Perl and Python
-
Re:Perl and Python
-
plenty of free books introducing programming
for example
Bruce Eckel's thinking in c++/java/python http://www.mindview.net/Books
some good free perl books http://learn.perl.org/
always javascript or
Introduction to Computer Science using Java
http://chortle.ccsu.edu/CS151/cs151java.htmlthere's more
-
Re:Article is a troll
RedHat seem to have an aggressive policy of incorporating pre-release changes in their released production code.
Great, so it's a repeat of the GCC 2.96 debacle.
Oh, and the link went to the wrong journal entry. Here's the right one.
-
Re:Article is a trollStill think it's a troll?
This is what a perl core hacker has to say about the issue:It seems that there is still a problem with RedHat's packaged perl 5.8."8"**. RedHat seem to have an aggressive policy of incorporating pre-release changes in their released production code. This would not be so bad if they actually communicated back with upstream (i.e. me and the other people on the perl5-porters mailing list), or demonstrated that they had sufficient in-house knowledge that they didn't need to. But evidence suggests that neither is true, certainly for 5.8.x
Let me stress that there has never been this problem in any released Perl, 5.8.7, 5.8.8, 5.10.0, and it won't be in 5.8.9 either when it comes out. The problem was caused by changes I made in the 5.8.x tree that RedHat integrated. End users reported the first bug something like 2 years ago, and RedHat closed it as "upstream patch" rather than reporting back "you know that pre-release change you made, that we integrated - well, it seems to have some problems"
(...)
For their versions affected, RedHat merely need to put out a patch integrating changes 31996, 32018, 32019 and 32025 which FIX IT, are documented as FIXING IT, and are from NOVEMBER 2007. -
Re:That's what you get.
could you explain what's crap about perl in fedora?
according to those perl guys, the fedora guys are quite good
from this blog
http://use.perl.org/~nicholas/journal/37274"â It has been a different matter for 5.10.0 in Fedora. For that, the maintainer has been very communicative, and so we were able to help him fix problems and get Perl 5.10.0 into Fedora Core 9."
-
Re:heyho, python - the new perl.
What the hell do you think HTML, XML, news stories, book descriptions, and reviews are? Are they not text?
Yahoo Shopping was written in Lisp. It was later rewritten, in sections at least, by a mixture of C++ and Perl. They wrote a Lisp interpreter in C++ to facilitate this.
Yahoo would have never happened without Perl.
Slashdot already ran a story about the BBC making a Rails-like framework for Perl because they liked Rails but prefer Perl as a language. The article at that second link says they're pretty dedicated to Perl for their whole Web infrastructure.
Amazon (for Amazon.com's own site) uses Mason (a Perl website templating system) as their official web development template system, and they're hiring for people with that skill set. They do use a lot of Java, too, apparently, but Perl is an important part of the site.
IMDb uses Linux, Apache, Perl and mod_perl to run pretty much the whole site, and is part of Amazon.
Google is using quite a bit of server-side JavaScript -- on the JVM as a replacement for Java in many cases.
Google uses C++, Python, and Java for most public-facing sites, and much of the management of the systems is done with Python.
This Google job (for a software engineer) lists C++ as a must and Python as a plus. This other job (for a software engineer) requires both one or more of C, C+, or Java and one or more of shell, Perl, PHP, or Python.
The nation of Scotland used Perl to migrate millions of land records between systems, which certainly is data munging, but a pretty important bit of it.
It was way back in 1999, but Agilent used Perl to build their big customer-facing e-commerce site.
Booking.com (part of Priceline) uses primarily Perl to run their site.
This PowerPoint presentation says Morgan Stanley in 2004 was using Perl written by over 500 developers on over 9000 (no, that's not a
/b/ ism) systems to keep their network running smoothly, for a web front end development language, to develop middleware, and to develop backend applications.ValueClick and TicketMaster make much use of Perl, too. That's along with the content management system -- Bricolage -- used by the Dean for President campaign, ETOnline, and the World Health Organization being written in Perl. You may have also heard of MovableType, which is a serious CMS from Six Apart. Or maybe you've heard of a site that runs it, called The Huffington Post, who right now is looking for someone to work on it?
-
Re:Ockham's Razor tells me....
No, we'd simply mock you for calling it "PERL" instead of "perl".
:)If you're going to criticize, get it right. Perl is a proper noun, so it should start with a capital. Check http://www.perl.org/ if you don't believe me.
-
Re:Perl IS the problem
I have never once heard those listed as "Perl mantras"... where is this coming from?
"We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris." -- Larry Wall, Programming Perl (1st edition), O'Reilly And Associates
If you need a more recent reference on that, it's also in the Perl manpage.
-
OO "fixed" in Perl 6
Whether OO is being fixed in Perl 6 is very much a matter of opinion. It's certainly being changed, but it was reading the planned directions for Perl 6 OO that made me learn Ruby. method doit (::?CLASS $self: $a, $b, $c) {
... } and $locator = -> $root, $x, $y { $root.[$x]{$y}[3] } ? No thanks.Sure, you can adopt best practices and write readable Perl code. The problem is, eventually you have to use someone else's Perl code. My experience is that I'm much more likely to be able to understand someone's Java or Ruby code than anything on CPAN. That holds true even for bad Java code that throws up a zillion warnings in Eclipse/PMD.
-
Re:Perl IS the problem
Well, considering you mentioned that you haven't seen a resource for learning Perl "that presents code that is well structured, commented, and tolerant of bad inputs" and I named 4 of the top 10 renowned authors of Perl books, I'd say it's fair to name them.
Since Perlmonks along with Use Perl; and the Perl newsgroups, IRC groups, and mailing lists are the Perl community, I'd say they are representative. Conway, Schwartz, Larry Wall, chromatic, brian d foy, and several other very respected authors of Perl (the language), perl (the language system), and references about Perl and perl have accounts on and are relatively active on Perlmonks, too.
If you speak about "the Perl programming community" and don't recognize those names, then what you know about the community is what's not representative of the community.
-
Re:Ockham's Razor tells me....
If only there was somewhere to rate CPAN packages...
Also, there are comp.lang.perl.misc and comp.lang.perl.moderated for Usenet, PerlMonks, Use Perl;, Perl.com, and many IRC channels, books, and mailing lists.
There are specific threads on Perlmonks about how to make it easier to choose which object-relational mapper, which text templating system, which web application framework, which object system, which date and time modules, and which modules for any given task.
Anything you want to do has two or three more popular, better documented ways with more community support and a host of other ways just in case. The community does a very good job of recommending one or two over the others.
-
Re:Ockham's Razor tells me....
If only there was somewhere to rate CPAN packages...
Also, there are comp.lang.perl.misc and comp.lang.perl.moderated for Usenet, PerlMonks, Use Perl;, Perl.com, and many IRC channels, books, and mailing lists.
There are specific threads on Perlmonks about how to make it easier to choose which object-relational mapper, which text templating system, which web application framework, which object system, which date and time modules, and which modules for any given task.
Anything you want to do has two or three more popular, better documented ways with more community support and a host of other ways just in case. The community does a very good job of recommending one or two over the others.
-
Re:I hate perl too
I don't think Perl is complicated. But it has some horrible bits of misdesign.
E.g.
http://perldoc.perl.org/perlvar.html
for (1..5){
nasty_break();
print "$_ ";
}
sub nasty_break {
$_ = 5;
# do something with $_
}You probably expect this code to print:
1 2 3 4 5but instead you get:
5 5 5 5 5Why? Because nasty_break() modifies $_ without localizing it first. The fix is to add local():
local $_ = 5;Ugh, so variables are not local by default. I also don't like the way it has magic globals with odd names like $_ and $\
It all seems like the language was designed so you could do something clever in an incomprehensible way in a
.sig, rather than for building large systems.Mind you I worked on a Perl project with some other people who came from a C background and the code was very readable. But the version of Perl we used didn't have prototypes for example, and doing C like things like structures was done with pack.
It's good for text processing of course, but I still think it's obscurantist rather than legitimately complicated. I actually find string processing in C (or better C++ with a decent string class) far more readable than a non trivial bunch of regexps - it's more verbose of course.
-
What's killing Perl...
...is backwards compatibility. In general, you can take some obscure piece of code that someone wrote almost a decade ago, and it will run on your modern Perl system. Unfortunately, people then take those obscure snippets of code, and try to learn from them. They may have been the best way to do things eight years ago, but they're certainly not now.As such, one of the hardest problems with Perl is education of new techniques. Too many systems still use CGI.pm when they could use Catalyst. They use some home-grown system of objects, when they could be using Moose. They put up with outdated techniques when Perl::Critic would find them in a heartbeat.
So, if everyone learnt the new techniques, we'd be fine, right? Unfortunately, it's not that simple. I teach Perl for a job, it's still an incredibly popular language here in Australia. But because that old code still works, I still need to teach people how to understand it, even if I then proceed to teach them better ways so they can avoid it. That increases cognitive workload, and there's only so much one can fit into a fresh brain during its first contact with a language.
Perl still remains the language of choice for writing minesweeper bots.
-
Re:I hate perl too
chomp is not ambiguous. RTFM and stop crying.
http://perldoc.perl.org/functions/chomp.html
This safer version of "chop" removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the English module). It returns the total number of characters removed from all its arguments. It's often used to remove the newline from the end of an input record when you're worried that the final record may be missing its newline. When in paragraph mode ($/ = "" ), it removes all trailing newlines from the string. When in slurp mode ($/ = undef ) or fixed-length record mode ($/ is a reference to an integer or the like, see perlvar) chomp() won't remove anything. If VARIABLE is omitted, it chomps $_ . Example:If anything I'm crying harder after reading that.
-
Re:Two Trojans For Mac OS X Users
Okay, so even though http://perldoc.perl.org/functions/qx.html claims that qx is just a generalised quotes operator, apparently it is actually used for system calls so that sorts out that. I'm not sure what the m($music)=> bit will do though, possibly match art within the version info? I'm using ActivePerl so the version info will be different from perl on Linux, can check up on OSX later though to see what is in there and if it's relevant.
-
Re:Two Trojans For Mac OS X Users
heh no I didn't run it I was just going through it in my head while checking back and forth with online documentation, mostly perlvar. It ended up being more like an hour and 20 minutes of looking at the actual code and then I was thinking about running parts of it today (not all of it obviously if it is going to do something malicious, just want to find out what effect changing $" has on quotes in practice etc) as I was heading to sleep
:PI'm not familiar with that use of q at all, I usually just use qq and curly braces for my quoting needs. I thought it perhaps was using the newline as the delimiter (which it could be if \n was assigned to S", though I'm not sure if reverse would also reverse a quoted string in that context, again something I'd have to try out) so blues would be a valid variable. If the quote does carry on to that line, wouldn't an error be thrown up when perl can't find $blues?
I might have a go trying a few things at lunchtime or after work, but for now I must get back to my not-quite-so-advanced perl hacking
:) Actually I just realised I must have been using perl since Feb 2007 when I started writing a web app for work to track the movements of their equipment. I for some reason though I'd only been using perl since feb this year - the time has flown by! 8| -
Re:Goes to show ...
I believe this is the PHP bug you mention: http://use.perl.org/~Aristotle/journal/33448 .
-
Re:more perl puzzles
How about
/@foo[bar]/? What are the possibilities?As the Perl 5 regular expression documentation suggests, the array @foo interpolates, following standard interpolation rules. [bar] is probably a character class, unless there's a single backslash at the end of the interpolated string, in which case the opening square bracket is a literal square bracket and the character class becomes a literal string.
What if $foo's value ended in a single backslash?? Would that matter here?
Yes.
Obviously I'm not very knowledgeable about Perl, but I believe my larger point is being made here.
Which larger point is that? Of course people who don't know a language don't understand it! Why is that a surprise?
-
Re:Some options
In the case of Perl (the language) and perl (the language system's implementation), there's The Perl Foundation. They pay bounties, give grants for certain projects, help support sites like Perlmonks and use Perl;, and more.
The tcpdump and libpcap projects are on SourceForge, but they don't have their donations link enabled. The projects' home page isn't coming up for me ATM, so I can't say if they have anything there.
The strace project is also on SourceForge and also does not have their donations enabled. The web page listed for the project is the project's SourceForge page itself, so I don't know where else to look off the top of my head.