Perl 5.6.1 Released, My Precioussss...
Pudge tells me
that perl 5.6.1 is released. Tell your boss you won't get any work done today, you have to, er, upgrade your personal knowledgebase of evolving regularly expressional technology. Then test every one of the bugfixes, like ""a\nxb\n" =~ /(?!\A)x/m". Pick your favorite new feature or bugfix from
the announcement
and tell us about it.
This reminds me of how Microsoft decided to take out the line "It makes a grown man cry" from the song Start me Up during their Windows 95 campaign. Can't imagine why.
Perl isn't about doing things other languages can't do. Perl is about doing things other languages can't do easily. Chances are, if you are doing a lot of string/text manipulation in C (especially if you are doing a lot of matching and replacing) you could get your job done a lot faster and easier in perl. A lot of 100+ line C programs can be broken down to a
Everybody I know who tried Perl's regular expression engine never went back. The C RE engine (that the manpage from 1994 claims is alpha quality) just doesn't have the rich feature set that the perl RE engine has. Perl's RE engine is constantly stress tested and obscure bugs are fixed, I'd dare say it is more stable than the C RE engine as well.
Perl also has a very comprehensive (if a little incomprehensible) package repository called CPAN. If you are looking to do something that somebody might have done before, chances are they DID do it before, and released the sources for free to a nice searchable database.
All this is just the tip of the iceberg. You really have to learn Perl (there are some great books available) to form your own opinions on it.
Down that path lies madness. On the other hand, the road to hell is paved with melting snowballs.
I read the internet for the articles.
It's braindead because:
* It forks another process to work that could easily be done inside perl itself. This makes your perl script much faster.
* He used a string instead of a list in the system() call. This is a potential security risk and slows tbings down even more because the shell must be invoked instead of the program being executed directly by perl.
* He didn't use s2p(1) to create the perl script. Larry write it for a reason!
I saw a similiar piece of code where I work recently that spawned 3 separate copies of mkdir, separately. And Perl has a builtin mkdir() function. Needless to say, this error was corrected.
-Dom
This sig left unintentionally blank.
To be truthful, someone generally easily finds a bug in the regex engine about twice a month. Yes, they tend to be on the most complex of regexes, but they are still there and still need to be fixed. Plus memory issues and the typical details you get into with any program.
"Pinky, you've left the lens cap of your mind on again." - P&TB
"I can see my house from here!" - ST:
Doesn't Java count? It has at least 3 kinds of week references (at least as of Java2, maybe before). I think they differ both in how weak they are, and in how they react to destruction (at least one fires before the object is destroyed giving time to save to disk, or make a stronger reference; at least one fires after destruction). One or more of the weak ref types may prevent collection until the system is actually low on memory.
That is one way to fix circular references. Another way would be to have a better garbage collector which can collect up circular references (that is in fact the traditional difference between reference counting which fails on circular references, and garbage collection which works).
This isn't a slam on Perl, it is nice that it now has this feature. Ref counts also have nice features (they aren't faster then a good GC, but the find the garbage they do find at more reliable times so destructors can be relied on to go off at useful times -- there are some hybread systems that do both to get both advantages, like Lucent's Alef).
The more common use of weak references (in languages with proper GC systems) is to have a cache. The cached item stays in memory until a GC sweep takes it away, if it is needed after that it has to be recalculated or read from disk again or something.
A structure with backlinks, such as a tree in which each node has a back pointer to its parent, is a great use for weak links. If you do that in Perl now, you can get a memory leak, because it looks like a circular reference and the reference counts won't go to 0. If the backlinks are weak links, the tree will be deleted when all external references to it go away.
The Perl implementation of weak links turns weak links to an object into "undef" when all the regular (strong) links go away. It's not clear if this can result in an object being deleted while in use. When you dereference a weak link, does that bump the reference count? Unclear. Details like this really matter in threaded programs, where one thread might drop an object in use by another thread. The Perl documentation is hazy on this.
I'd like to use it, but my Perl code has to run on servers that don't run the latest Perl. It's going to be useful in future, once newer Perl implementations are widely deployed. Once it's standard, widely used tree structures like HTML::Element should use it.
Considering you can write ASP in Perl I would say that your not propelry informed. You can do ASP in JScript, Perl, VBScript etc.
Given that all of those are available to ASP use whichever you like to your hearts content.
The most common language is VBScript in ASP. However I have seen them all used to varying degrees of coherency and success. (The perl parts being the least coherent and most painful to fix... odd) Anyways apples and oranges. Cant compare ASP to Perl. Try comparing VBScript to Perl. Then we can get a good discussion about two languages going.
Jeremy
Why are regular expressions called that? Regular in what way?
--
Scott Robert Ladd
Master of Complexity
Destroyer of Order and Chaos
All about me
with a language as utterly inexplicable as perl, i wonder how programmers *find* bugs, especially in later releases, where the bugs are that much more obscure.
/(?!\A)x/m doesn't properly eval-yoo-ate for certain prop'rties of 'nxb'.
"Say, Cletus, ah jist noticed that "a\nxb\n" =~
then again, i suppose it's about as easy as finding all the little discrepancies between Microsoft's idea of C++ and the ANSI standard -- a famous example is Microsoft's interpretation of the scope of variables declared inside the conditional section of a for loop. with "for(int i..." in standard C++, i's scope is for the duration of the loop. in MSVC, you've just declared a new variable, so putting two for loops in a row with the same variable initialization will cause compiler errors which you *shouldn't be seeing*.
--nick
It just occurred to me, how many departments does slashdot HAVE? I've seen hundred and hundreds already. Where do you find managers and resources for an operation that large?
--------------------------------