Larry Wall Announces Perl 6
The following was written by Chris "Pudge" Nandor... Perl Guru, Slashcode Guru, and all around swell guy.
Perl 6 To Be Complete Rewrite (But Not What You Think)Larry Wall and other active Perl porters and Perl helpers met on Tuesday afternoon at Perl Conference 4.0 and mapped out a what is planned to become a complete rewrite of Perl that will become Perl 6 in 18 to 24 months, with a prerelease targeted for next year's conference.
Perl 5 will not be abandoned, but will primarily be concerned with bugfixes both major and minor.
The meeting for members of the perl5-porters mailing list was the result of an earlier, smaller meeting of Wall, Nathan Torkington, Chip Salzenberg, and others who basically decided that Perl needed to be fixed in certain ways, and that a rewrite was the best way to do it. Salzenberg started the Topaz project two years ago, to reimplement Perl in C++. Though Topaz itself will not be the basis for Perl 6, Salzenberg noted that the lessons learned in the experience will be very helpful to the new effort.
Torkington led the three-hour meeting, starting off by saying what was wrong with Perl. Much of the focus on the problems with Perl centered around how increasingly difficult it was to improve, extend, and embed Perl. A rewrite and redesign are needed, he said, and maybe it is time for a hard change. So while the focus of the effort seems to be on improving the Perl guts and API, the project will also be used as an opportunity to clean out some of the cruft, including bad and seldom-used features.
Some of the primary (and still vague) goals of the effort will be to reimplement the core so it is better, stronger, and faster; improve syntax; add new features where appropriate; have better version and installation management for perl and its modules; and have a clear and automated migration path, which may include a backward compatibility mode. Some old features may be removed, like typeglobs. Others will be improved.
The group hopes to re-shape Perl community, too. Instead of one all-encompassing perl5-porters list, tightly focused mailing lists with a terminal lifespan will be formed. To start off, the mailing list bootstrap at perl.org will be for discussion of the beginnings of the project. Like most, if not all, other new lists, when it has fulfilled its purpose, it will be closed.
Wall said, "Perl 5 was my rewrite of perl ... I think this should be the community's rewrite of perl, and the community's rewrite of the community."
Specifics have not yet been ironed out. A group has been formed to begin the work, which will primarily consist of planning the work to be done. No coding is to be done at this stage, only planning and support. Roles were determined for the group, and then they were filled. They now include the perl 5 maintainer (Jarkko Hietaniemi and Nick Ing-Simmons), the language design pumpking (Larry Wall), the internals design pumpking (Dan Sugalski), the documentation manager (Adam Turoff), the system administrator (Ask Bjoern Hansen), the quality assurance bloke (Michael Schwern), the spokesdroid (brian d foy), the customer relations person (Dick Hardt), and the project manager himself, Nathan Torkington. Other porters, such as Chip Salzenberg, volunteered to consult when needed.
Some of the short term goals of this group are to draft a language specification, start an RFC channel, get feedback, and set up mailing lists, a documentation repository, and a web site. Hansen will be setting up the mailing lists. The bootstrap list will be open to the public, while the list for the intial small group of people will be closed for posting by anyone not on the list. All lists will be readable by the public, through the web, and perhaps through email. Turoff is going to be preparing the notes for the morning meeting, and foy will be posting the notes and the mailing list links on the www.perl.org web site.
In keeping with the spirit of Perl, heavy use will be made of default variables in this new system. So for example, the commonly used "print" command will be replaced by:
And the almost-as-common "if" will become:
Instead of "foreach" it will be possible to use:
And lastly, any reference to "$_" or "($_)" can be replaced by:
So a typical Perl 6 program segment might look like this.
#!/usr/bin/perl
;
(@_){
{
}
}
Larry has expressed his gratitude to the Python developers for their initial work in this area.
I feel...a module coming on. Except that I'm certain that somebody else has already written a chunk of perl code to slashguard (new verb?) an arbitrary chunk of perl code. And then they probably used slashguard.pl to post the contents of slashguard.pl onto slashdot.
So, anybody got that URL handy? :-)
Babar
C was based on B, which was designed almost entirely by a single person. K&R literally wrote the book on the pre-ANSI C language. C89 codified most of original C. C99 represents only minor changes to the specification of the language (restrict, long longs, and implicit casts to UDTs in actual parameters being the more important changes). C++ was designed by Stroustroup, but unfortunately the committee made some elephantine changes to the language. STL and namespaces is about the only good things, IMHO, that came out of standardization. The latest ISO C++ standard has certain flaws (limits on access of friends, among other things) that I think severely degrade the usefulness of the language.
The talk about rewriting Perl in C++ is misguided. C++ is not necessarily better for all projects than C. C++ helps with large systems, yes, but can also provide more portability problems and many more traps for programmers. "Rewrite system X in pet language Y" is the standard hacker move, though it may not have any point whatsoever.
Just coming off of a large project written in C++, I'm not sure I would do it again. C++ used lightly (variable declarations in for statements), or used with full Object Oriented Design can be a boon, but is just so much rope for you to hang yourself if just look at C++ as a language with lots more features.
This is irrelevant, of course, and I see myself starting a C vs. C++ battle, so I'll shut up. The bottom line is that rewriting an existing, working, and reliable program in another language--for no real reason--doesn't make sense.
You've not played with mod_perl much have you?
I have to agree Perl's OO implementation is pretty bad but it does work though.
Large projects are difficult to do with perl because of this.
I think a redesign would be an excellent idea.
Maybe bring the keyword class.
"If a show of teeth is not enough, bite
> prototype ... in perl ... translates it into
:-)
/why/ would you want to do that? I mean, presumably it's some Dilbert-style management decision, but which MS marketing scam was it they fell for?
> VBscript asp's
*vomit*
Seriously,
Your example of some Perl code:
... ... and replace with nothing
s#<(?!$okay_tags)([^>]*>)##gi;
The problem isn't so much Perl as the syntax for regular expressions. They are designed to describe patterns of characters in as little space as possible. Perl actually helps things. For example:
# Remove any HTML tag in the submitted code
# that is not in the list of okay HTML tags.
$submitted_code =~ s
# search for
{
< # start of HTML tag
(?!$okay_tags) # do NOT match $okay_tags
[^>]* # any number of characters EXCEPT the HTML close
> # end of HTML tag
}
#
{}
# globally, ignore case, eXtended regexps
gix;
You can write bad code in any language. Perl is just about the only place you can write clear, well-commented regexps.
[Note: There may well be syntax errors in the above, as it took me forever just to get everything formatted right. (If you think Perl's bad, try translating Perl into guarded HTML!) I certainly can't run it all through the interpreter to check my translation. And I know there's at least one logic bug in the code.]
dragonhawk@iname.microsoft.com
I do not like Microsoft. Remove them from my email address.
O.K. a Perl anti-zealot
Now if your concerns are aestetic and are bothered by the overuse of symbols I doubt there will be any change in Perl 6 that will convince you.
For example the data type differentiators ($,%,@) are kinda central to the language. And like almost any unfamiliar language dialect, it looks odd at first glance. Symbols are symbols and all languages are built from symbols. Take an uninitiate and give them some C++ code, Perl code, Pascal Code and and maybe some Greek and ask them which is more intuitive and aestetic - to them it would all look like line noise.
You could look at this way Python enforces indention style with mandatory whitespaces. Perl enforces variable nameing style with a built in variable naming convention ( $ -> scalar data, @ -> arrays, % -> hashes).
BTW, your original complaint about Perl's loose typing is also true with Python. For alot of programming chores its a feature not a deficiency.
The problem here is the example is slightly more advanced (and obfuscated) than it needs to be.
if he had written something like:
$test="many words";
$test=~s/many/few/gi;
then you might figure out that we're looking at a method to substitute text.
it's practically the same as what he wrote but just a bit easier on the eyes.
people think perl is more confusing than c++ probably because when you become adept at programming in perl, you start using various shortcuts that make the code look like gibberish but function the same way. the problem is that for some odd reason a perl programmer will never show a beginner a decently formatted, light script but rather some horrible looking script using typeglobs and arrays of hashes of arrays.... must be some sort of pride issue.
I suppose it's true that if I were a typical perl programmer (ie - stupid) I would find writing writing that Java code over and over again pretty tedious, and I would prefer the one-liner approach to everything.
Fortunately, I'm not, so I don't write the same code over and over again. I write it once, and make use of it for years on end. It's called good program design - maybe you should try it.
First, make it work, then make it right, then make it fast, then, make it bloated!
use constant FOO => 'bar';
HTH, HAND.
That isn't because of the type system being too strong in Java, it is the lack of the concept of a tuple, or of multiple return values and simaltanious assignment.
The language Dis is very strongly typed, but it has a tuple type, and you could do this:
int z, z;
string y
x,y,z = function();
Or you could so long as 'function' was declared to return 'tuple(int,string,int)'.
Yes, that would require a 'rowFetch' for each kind of row, but I'm not sure that is a bad idea.
There are other strongly typed languages with 'vartype' escape hatches, which let you have the advantages of strong types when you want them, and the advantages of weak types when you want them, with the disadvantage that the compiler is more complex, and you might have to maintian code from someone who used weak types everywhere....
P.S. Dis is really a cool language. It has full GC so objects with cycles won't hurt it (like they do Perl, at least Perl5), but reference counts so non-circularly referenced objects have a predictable destruct time allowing you to use the C++ style "resource allocation is object creation" idom which makes exception handling and the like so much less painful. Alef is similar in some ways, and has some other intresting concepts.
open my $fh, $path or die $!;
Hmm, gotta try that. What about the amount of stuff on CPAN that might break if the glob is removed? What's the current stance on that?
"No... The question is, which version of perl will it run in."
Why would you need it to run in anything but Perl 6?
"And like that
You don't actually need an explicit return:
:)
sub foo { "bar" }
This is actually how "use constant" works internally: it fakes up a subroutine that (implicitly) returns the requested value.
Since the subroutine is defined at compile time, and the compiler sees that it returns a constant value, the constant value is inlined in place of the subroutine call.
So, constants work and are exactly as fast as you'd expect, even though it may seem odd to people without backgrounds in functional languages that a constant is really a special case of a function, but with a built-in performance hack.
ActiveState did not port Python to Windows. Python has run on Windows for almost a decade. As far as I know, it has run on Windows since versin 1. ActiveState does support some platform-specific enhancements to Python for Windows and other platforms. ActiveState also supports platform-independent extensions to Python.
Jeff
If a "preview release should be available by next summer," significant amounts of production software can't be expected until 2002 at the earliest. By that time, current software will perform 3-5x faster on equivalent hardware.
Given Perl's huge installed base, I have no doubt that there are dozens, hundreds, maybe even a few thousand programmers who could benefit from a faster Perl two years from now. But for the majority of the world, the speed that matters is programmer productivity. I hope the Perl 6 team focuses on that.
I'll give you the binaries. The rest can already be done, and while TMTOWTDI is the motto. You'll find people reluctant to replace INTERNAL functionality at the drop of a hat. See the debate over ??= http://www.perl.com/tchrist/defop/defconfaq.html
Were that I say, pancakes?
---------///----------
--
I like to watch.
PHP isn't really a competitor to Perl in the CGI space. PHP is embeded in an HTML page, whereas a Perl CGI is more likely to be in the backend, or at most generating HTML. There are HTML::Embperl, ePerl, and maybe other embeded perl options, but probably the way most people use Perl is not comparable to PHP.
Err, that's not even vaguely true.
The problem I have is that Perl interpreters seem to be pretty low on most companies' upgrade lists. My current employer still runs 5.005, on both AIX and Solaris. If I can't convince them to upgrade to 5.6, 6.0 seems right out. "There's a chance of older scripts breaking, right? 5.005 works for us now, right? So why bother?" Bah. It sucks that businesses are run by businesspeople. ;) Oh well, I've seen worse... a web hosting company (which advertises on Slashdot, btw) runs 5.004 on Linux boxen. It somehow seems worse that Linux people not be up-to-date on this stuff.
Question for anyone who knows: which version does /. use?
It sucks that any cool new things I could do with Perl 6 are pointless if I can't use them at sites with older interpreters. I think the next Slashdot poll should be,
---------///----------
--
I like to watch.
This is a questionable feature of Perl, IMHO. While I hate "fascist" languages that insist on you doing things their way and their way alone, Perl's looseness can lead to maintenance nightmares. Few people will have the time to learn all of Perl's multifarious ways of accomplishing a single task; therefore it's possible to have two Perl wizards in the same organisation whose working sets of favoured Perl idioms don't overlap much. If one wizard leaves and the other undertakes to maintain their scripts, the maintainer is going to have some fun deciphering just what the hell the other wizard was up to. Now, all languages are going to have this problem to an extent (e.g. witness how something as trivial an unfamiliar indenting style in a C program can throw you off), but Perl amplifies it to a perverse degree.
But what would your comment say? For instance, would you indicate in your comment that this code will *not* properly handle HTML comments or Javascript content?
IMO, this is the evilness of perl: it leads you on to think that the trivial hack is actually a correct solution.
- '()
If they were really cool, they'd write it in PERL.
print while <>;
Got HTML? Want LaTeX? Try html2latex
Now all I want to know is if those funky Lee Majors sound effects are going to happen any time I access a page with a .cgi extension...
My understanding of what Larry was saying during the keynote was that the way that he plans on maintaining compatibility with Perl5 is by building an internal representation of the script, converting that to the new syntax, and dumping it back out to disk. Apparently there is a module currently on the CPAN that does something similar to this already: building the symbol table, and dumping it out to disk. Having this capability seems to be how he feels he can make (relatively) large changes to the syntax of the language without breaking all of the existing code. He also mentioned that this would almost certainly not work for 100% of the existing code, but if they could get it to 85% or so, that would be an acceptable solution.
The " Doneness" listing indicates that virtually all of the commands are done, and the last date that something was updated was in June 1999.
It may well be effectively complete. I don't think PPT has taken the world by storm, though...
If you're not part of the solution, you're part of the precipitate.
Will they rewrite Perl in Perl?
Actually, during the Q and A session with Larry after his announcement, someone asked if Perl would ever have any strong typing. Larry's response was that the hooks for that already exist, and having a pragma that turned on type could be something that would be considered for Perl6. The suggestion that he made for the new pragma name (obviously in jest) was 'use bondage and discipline'
Actually, Perl does this without a problem. It's just a matter of using references to your advantage. As an example, here is a three dimensional array: $array[0]->[0]->[0]. Any structure you make in C, I can make in Perl. For a lot more details, I would suggest reading the perlstruct pod page that comes with Perl, or take a look at a few of the examples in the Perl Cookbook. You just have to think in a Perlish sort of way.
Hey, I like my C++ short and terse too, but I don't care for entire subroutines mostly written in punctuation.
This is a myth. You can right perfectly readable and maintainable perl. I currently prototype web pages in perl using cgi.pm and hand it off to an asp developer who translates it into VBscript asp's and cleans up the user interface. The guy had close to zero perl experience when he started, but was able to read an understand my perl almost immediately.
You can write unreadable perl, and that's a godsend for 1 shot scripts, but you can also write very readable perl. It's a language of acceptable subsets.
--Shoeboy
I really think that one of the reasons that the Perl modules are SO useful is due to the lack of strong typing ala Java.
A PERFECT example of this is the DBI library. In Perl, it's simple. You can even do
($id, $firstname, $lastname) = $sth->fetch_row();
In Java, with the JDBC, you have to do this:
(assuming rs is a ResultSet object)
int id = rs.getInteger(1);
String firstname = rs.getString(2);
String lastname = rs.getString(3);
(forgive the syntax if it isn't 100% correct; you should be able to understand the point though.)
The point? Because of Perl's lack of strong typing, it's a hell of a lot simpler to get what I need done: extract a userid, first and last name from a database.
Lots of other modules are like this as well. The result? A looseky bound language that makes it really simple to put different modules together to get something done. In my years of experience in using C++, this is pretty difficult to do: everyone does the data storage differently, leading to a variety of problems. This is still true in Java, but to a much lesser degree.
This is why Perl will never be burdened with strong typing.
Still, Slashdot did post a "benchmark comparison" study a couple months ago, which found that text parsing "as written by experienced, competent programmers" in C didn't hold up against Perl's text parsing.
:)
That would depend on whether or not Perl's regex code is as good as / better than the POSIX regex(3) functions. And if glibc's regex(3) isn't as good as Perls code, they (they being the GNU folks) need to steal it from Perl ASAP.
I agree that it's a little weird to benchmark something against its parent. Maybe what they meant is "PERL handles text better than YOU."
Given the correct modules, Perl also programs Perl better than I do.
I guess I should really qualify these things. Every other person asks me this. Yes I've used mod_perl, and I've even found better solutions ( such as FastCGI ). This was really the type of general purpose solution I was talking about. The PHP comment had to do with how quickly you get get a dynamic web site up. A Cold Fusion engine referred to a potentially higher throughput engine.
-Michael
-Michael
>that some people were going to rewrite all of >the Unix commands
Why? You want cat, you do:
open(FILE,"somefile.txt");
while()
{
print $_;
}
close(FILE);
You want ls, you can do:
opendir(DIR,"somedir");
while($filename=readdir(DIR))
{
print "$filename\n";
}
closedir(DIR);
For *most* unix commands, it's simple to do it in your perl script with just a few lines.
//m
Perl is great, until you work with C for a while, come back, whip up a quit solution involving multidimensional arrays, find it doesn't work, and spend half the day trying to figure out the right syntax to get it to work with references and all.
Also, structures would be nice. It's easy to do using hashes, but it's a pain to type. I'd suggest the dot notation, but it would break concatenation. Are there any symbols left for this?
Trust me on this.
Wait for 5.6.1 (which will be out fairly shortly).
If you must use the new features, then figure out how to get the current development version of Perl and use that.
Otherwise you will get burned.
(Hint to the wise. Saying that *.0 releases are stable is a marketing label. This is definitely the case with 5.6.0.)
Ben
My usual seat in the cluetrain is at A HREF="http://pub4.ezboard.com/biwethey.ht
---------///----------
--
I like to watch.
Ilya left perl5porters.
I don't see Tom Christiansen mentioned here. Has he left too?
And what about Sarathy?
Good point.. also, (cheap) computers are much faster than we need them to be now anyway, so I guess even if it's marginally slower, few people really care.
Though, true, the web is mainly text, but I never thought of the web so much about text manipulation, that is, not more so than pulling data out of a database and reformatting it is about text manipulation (which it is). Before the web, was Perl used for this sort of thing as well?
For crawlers and all sorts of web bots, the web is about text manipulation. For serving up web pages, which often contain static data, I guess Perl is fast enough too.
Will perl 5 source be 100% ok with perl6 or will i have to rewrite code?
---------///----------
--
I like to watch.
Also, strong typing can be more efficient. When you say getInteger(), the compiler doesn't have to waste cycles trying to figure out if it's an integer, string, float, etc.
BTW, C++ allows you to emulate weak typing where it's appropriate, using operator overloading. Say I've created a SpecialInt class that contains an int, plus does some other special stuff I need for some reason, I can make it interchangeable with an int, like this:
--Ask a silly person, get a silly answer.
This might explain the name ActivePerl (and ActiveState). Nobody likes the word "active" more than Microsoft.
Save your wrists today - switch to Dvorak
It's simple: Perl parses and compiles regular expressions at compile time. In C it has to be done at runtime. Now, compiletime == runtime in Perl for the most part ... except if the script persists, as in mod_perl or fast_cgi or any daemon for that matter, as opposed to plain old CGIs and commands.
Change is scary. But it sounds like this change will be pretty transparent to programmers; perl will continue to get faster and better, still stay easy to use, and Larry Wall is still a little crazy. Well, it sounds like everything is right in the world.
Sure... I just go and buy myself some Perl books for the "old" version and then they have to go and make a new one. :)
Perl's text algorithms were designed and coded by experts and optmized over time. The adhoc regex function Joe Coder writes will NOT be nearly as smart. Thus Perl can be [much] faster than C in some instances.
cpeterso
"[the] community's rewrite of perl, and the community's rewrite of the community."
This should be interesting. I assume this means everyone will be able to go to the perl mailing lists & suggest things to change for perl 6? That'd be useful, and I'd assume many people will do this. If it actually goes down this way, I wonder how different perl will be in version 6. Will perl change to accomodate people who like python, or c, or will it just be perl with new p- & c-like features, or just a very different perl? Any way it comes out, I have a feeling it will be a better perl because of Wall's attempt to get the community to make perl better.
--
TheDude
Smokedot
Drug Info, Rights, Laws, and Discussion
TheDude
Smokedot
Drug Info, Rights, Laws, and Discussion
I've upgraded a few scripts, but not all that many. As far as using the new functionality, in new scripts, you betcha! I have a really hard time going back to Perl4 and not having references, hashes of hashes [...], arrays of arrays [...], etc, etc. Perl5 lets you do much more complex data structures than Perl4. If you *have* Perl5, it's well worth your time to learn to *use* Perl5.
My
---------///----------
--
I like to watch.
The possible removal of typeglobs (from above) is kinda disturbing, I have to say. But if they make files, formats, and a few other things first class, it should be okay. (I hope).
The above is also found in it's original form at use.perl.org. use.perl.org is a great site, and also based on Slash (the slashdot.org engine).
First of all, here's a list of things i don't like (just so you know i'm being fair):
1) The lack of constants: The only way to do constants is to create a subroutine that returns whatever value you want to be constant, ie: sub foo{ return "bar";}
--BlueLines "The cost of living hasn't affected it's popularity." -anonymous
Here's a regexp I saw in some perl yesterday:
:)
s#<(?!$okay_tags)([^>]*>)##gi;
Think it's unreadable? What about this sentence:
"Cette phrase en francais est difficile a traduire en anglais." (From Douglas Hofstader's "Metamagical Themas")
The point is, it's impossible to read anything until you know the language. I know that the above perl reads "zap all html tags not in the list of ok tags. " (Of course, I have the benefit of knowing what the context for the line was).
So, yeah - perl is ugly unless you know it.... just like any other language. Also, I think C++ uses all the punctiation that perl does, just not as often
-Dave Turner.
Become a FSF associate member before the low #s are used
ok.. so i don't know much about php.. you caught me..
but there are other competitors, and that is what my post was about.. the "spirit" of competition in the cgi sector..
(i'm a c++ guy now, though.. i eat better than i did when i did perl/cgi)
patroll
Will the real Richard Stallman please stand up?
>Err, that's not even vaguely true.
I am going to assume that you've dealt with the perl core code, so I'm not going to debate with you. But to defend myself to others, let me say this: Scalars are a dynamic type which encompases integers ( in optimized cases ), floating point, strings and references ( which are the basis of most perl complex datatypes, including objects ). When in doubt, perl makes something a string. To my knowledge, DBI reads come in as strings ( I could do a test, but frankly I don't care enough ). Flags in the scalar object specify if it is currently in int/float/string/pointer form, and it's possible to flip flop around in most directions ( even from a pointer ). Because of this, you can always treat the scalar as a string. Hense my comment.
I think your biggest reaction had to deal with the defamation of perl sophistication, perhaps likening it onto something like COBOL, which uses pseudo-ASCII numbers ( 4 bit digits, if I recall ).
-Michael
-Michael
print while <>;
How about one better?
print <>;
Wrong, Perl excels at text manipulation and the web is mainly...text. Try doing text manipulation in C or Java and see how much more quickly it can be done in Perl.
C does'nt really have to suck at string manipulation, it just happens to, thanks (or no thanks at all) to the crappy, insecure, C library.
It's a shame nobody cared to spec out a standard text handling library in C? Or it has been done but I'm not aware of it. I know of DJB's effort ... as used in Qmail ... it's funky though, and not exactly standard by any means.
C++ is k3wl in that respect, but I used to get a bit alarmed at the the ASM code I was getting ... oh wait that was a long time ago. 68k assembler. Duh. Nobody does that anymore. Oh forget it.
Eric Raymond's typically well-argued Why Python? piece in the May 2000 Linux Journal has this to say about Perl Syntax: Larger project size seemed to magnify some of Perl's annoyances into serious, continuing problems. The syntax that had seemed merely eccentric at a hundred lines began to seem like a nigh-impenetrable hedge of thorns at a thousand. ``More than one way to do it'' lent flavor and expressiveness at a small scale, but made it significantly harder to maintain consistent style across a wider code base. And many of the features that were later patched into Perl to address the complexity-control needs of bigger programs (objects, lexical scoping, ``use strict'', etc.) had a fragile, jerry-rigged feel about them. He makes a strong case for (more or less) abandoning Perl for Python, specially for new programmers. Since the world needs a lot more programmers than there are now, the learning-curve argument is probably the strongest one against Perl (only in a Perl vs. Python context though). Specially when it comes from Eric Raymond!
-- Abigail
http://www.technetcast.com/tnc_program.html?progra m_id=85
I've never used pack.
XS is hmmm .. well quite complicated, never got around to use it. I used to extend TCL with C procedures, and even without dynamic libs it was a breeze.
(no text, see the title)
If you put export PERL5OPT='-Mstrict' in your profile, then it will already happen.
-- Abigail
-- Abigail
You just KNOW there's gonna be a perl script that will convert your old perl scripts into your new perl scripts. The only question is... will it be a one-liner?
-thomas
"And like that
Hi. Read this: http://www.kuro5h in.org/?op=displaystory&sid=2000/7/18/122257/231. Please don't b-slap me; this is important! Mkay?
--
--
He lives in a world where those who do not run the client software of the omnipresent meme are unacceptable.
I'm at the perl conference right now (using their wireless connectivity which is pretty cool), and I saw Larry Wall's keynote speech. He said "I hope we have 100% compatability with all Perl 5 scripts, but I don't think that will happen [with Perl 6]. If we have 100% compatability with 80% of the scripts out there, that's good in my opinion. If we have 95% compatability with 100% of the scripts, that's good. As long as we're in the ballpark, it's ok. You have to break a few...umm..somethings to make an omlette."
.anonymous coward.
Ah well, that failed to work, didn't it? :-)
Those were supposed to be links to the appropriate pages on perl.com. I'm sure you can find them or look at the local versions...
Ho hum.
PHP4 does as part of the 'pear' library (kinda like perl's CPAN).
It's one up on perl though, because (since it's small at the moment) all the pear modules come with PHP itself, you don't need to download/install them from an external source.
I've never much cared for the way variables are declared and used in Perl (scalars?). Too much use of symbols, not enough grammar.
Hmm... I like it. When the language has built in support for complex datatypes it's useful. Take T-SQL for example:
DECLARE @bob varchar(255)
SELECT @bob = max(bob) FROM tbl_bob
It's unfathomably useful to be able to tell at a glance whether you're dealing with a variable or an attribute of a tuple.
Perl is the same way. I find it nice to be able to tell at a glance whether I'm using a scalar or a list.
--Shoeboy
I forget the exact details (it was posted here quite a few months ago), but doesn't Microsoft, the master of vaporware, somehow influence the Perl development group with a hefty financial arrangement?
I personally love coding in Perl for that exact reason, that there are tons of ways to do everything. It also makes for entertaining conversation with friends to see how different people solved the same or similar problems in different ways.
I might just be biased on this from the heavy amount of web developement I do, but I'm anxiously awaiting the new version. I just hope it won't require 100% rewrite of my old scripts.
Ok, Perl is faster and better and its a complete re-write?!?
Yeah right. All I know is that you are never going to get all three things right the first time off. It may be faster and a complete re-write or better and a complete re-write but come on. Larry Wall may be wired tight for coding but I will believe the perfect perl when I C it.
ACK
I didn't attempt a wholesale upgrade of my Perl4 scripts. If it ain't broke, don't fix it! However, once I got Srinivasan's Advanced Perl Programming and figured out how to really make use of all those cool new features, my scripts take serious advantage of Perl5's new features. In particular I make heavy use of references and complex data types, and I love the IO::Socket and Net::* modules!
Perl6 had better not break 99% of the legacy Perl4 and Perl5 code out there. I'd hate to have to convert a ton of scripts! But if it introduces useful new features I sure won't be shy about using them.
Chelloveck
I give up on debugging. From now on, SIGSEGV is a feature.
(ack. I'm sure IE was written to piss vi users off. Pressing Escape shouldn't clear the text box, FFS)
:-)
> about a kajillion different ways to do the same
> thing
Otherwise known as "There's More Than One Way To Do It", one of the central mantras of Perl
The way I see Perl is that if you have a messy mind, you'll create crappy perl. If you've got a focussed mind, you'll create focussed perl. You impose the discipline on perl, it doesn't impose the discipline on you. It's the most direct and natural way I've ever seen for transferring thoughts to real code. (Painting By Numbers doesn't count).
> language-based improvements
I don't see what improvements there could be.
When I learnt to program in BASIC, I felt there were things missing, although I only had a vague idea of what they were. I moved on to C and found lots of the gaps filled, but still that nagging feeling something was missing.
I found perl, and I've *never* thought "Hrm, I wish Perl did " or "Why does it do it like that? It'd be much better like ?" about Perl...
> I really think that one of the reasons that the > Perl modules are SO useful is due to the lack of > strong typing ala Java.
> A PERFECT example of this is the DBI library. In > Perl, it's simple. You can even do
> ($id, $firstname, $lastname) =$sth->fetch_row();
> In Java, with the JDBC, you have to do this:
> (assuming rs is a ResultSet object)
> int id = rs.getInteger(1);
> String firstname = rs.getString(2);
> String lastname = rs.getString(3);
That's a very misleading argument. You're comparing the functionality offered by a 3rd party perl module with the functionality offered by the standard JVM. A better example would be to compare perl's DBI/D modules with, say, the castor project (http://castor.exolab.org/). Using castor, one can serialize complex objects to and from a SQL data source without doing all of the work by hand.
So how easy is it to convert vbscript to perl automatically?
.. 75% with 2years development effort.. SIGH
Working in parsing for Oracle I just know the answer is, you could do 50% of this easy 70% with 1years development effoort
open source: resistance is futile.
Be Free: Free Software Tuition
I find Perl especially aesthetic, especially those dollar signs -- the ones in front of the multiple digits on the checks my employer gives me for writing Perl code.
--
Someone you trust is one of us.
The speed part comes not from execution, since Perl scripts run about fast as compiled binaries, but from saving from doing the recompilation each time you run the script.
Rule #1 in programming: Never use a comment to explain how your code works instead of what it does or why it does it. It's much better to write the code so that the _working_ is obvious, and it's a waste of time to explain badly written code.
Ivo
<grub> Reading
I bet you like hungarian notation, too, you moron.
Don't complicate the language with functionality that belongs in the class/object browser.
Class/object browser? My copy of vi doesn't have this thing.
--Shoeboy
Object o = list.get(i);
then to do anything useful I have to cast that object o into the object type I believe it to be. Of course there are various solutions to this (templated Java etc.) but the problem exists in vanilla Java.
Yeah I noticed that a few months while browsing p5p's archive ... and I was quite shocked. Larry Wall was commenting on a poster's obfuscated perl and told him that it took him only a split second to figure out what it meant ... "but you have to keep in mind that I won the IOCCC both times I entered". Hell, me thinks he's been playing a bad joke on us for all that time ...
see www.python.org :-)
Perl has always been nice to do short, but powerful code. Even large projects can be done with Perl. However what I detest most about coding in Perl has always been how to implement OO. It would be terrific if there was a more elegant way to implement OO. Perl's OO seems like it was simply a graph on top of the modules system.
I used to have a very large and handy string handling library for C in my toolkit, but lost it during a disk crash some years ago.
I have often wondered if anyone has ever started a project to build a good quality text/string handling library for C - anyone know?
Might be handy to bang some stuff together.
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
It can be very very dirty, but it depends on the mortality of the script. And dirty isn't such a bad thing. ;-)
If I know the script is going to be used by many people, I avoid all the cute little tricks that Perl allows. I hate to do it b/c I get off on being a slick programmer, but even I forget what the heck my scripts do after six months.
However, if I'm writing scripts on the fly for myself, I try to exploit the least verbose syntax forms. To quote a former programming mentor "You know you're done when you can't remove any more redundant code..." If I start to use the script frequently, I'll comment heavily.
Question is, how radical will the changes be? I mean, I don't use sockets or Tcl, I just stick to Perl basics, so will it affect (effect?) me? (grammer nazi, please indicate the proper verb.)
---
https://www.accountkiller.com/removal-requested
Enjoy!
I've been speaking French about as long as I've been learning Perl. I understood the French instantly. I still don't really comprehend the Perl.
Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
This is the reason I believe Perl needs work before being used for anything serious. The above example though contrived shows one of the dangers of Perl. In a strongly typed language if I do
String ssn = rs.getFloat(4);
String firstname = rs.getString(2);
String lastname = rs.getString(3);
float cash = rs.getString(1);
I will get an error or thrown Exception for trying to convert a float to a string without a cast while in Perl this error will be allowed to silently propagate through the system causing wasted time later glancing at line-noise-like syntax trying to track down a bug that is due to the typelessness of the language.
PS: Automatic initialization of variables thus causing typos to be treated as variables is another pet peeve of mine. Besides that Perl is really good at quick-and-dirty text manipulation which is what it excels in.
The way I've expressed this thought is:
"Perl is APL on LSD"
A way to generate binaries, if only to gain some speed.
Sane ways to implement complex data structures. I often dream at night about being able to do records in Perl like in Pascal.
I'd like to have an array hold a collection of hashes. I'd like a hash that could return arrays as values, and a way to tie() them to db files. And I don't want to screw around with references. I'm a lame programmer, so I usually just store arrays in my hashes as join()'d scalars, which means I'm constantly winding and unwinding them.
I agree with Shoeboy, Perl isn't that hard to read. I'm not even a Perl-Master or anything. Perl is one of the easiest languages I've ever had the pleasure of learning, you can start writing useful programs in about a day. Sometimes it's hard to read the regular expressions, and most of the time, when I'm reading code, looking for bugs, I glance past the regular expressions, keeping note that there was one, if I don't find a bug, I then go back and examine them. They're easy to pick out, once you spend a week or so on them, they aren't so hard to decipher.. that's actually how I learned regexps, by looking at an parser which I knew worked and I had the original data file handy. An O'Reilly book or the Perl Documentation page at your side helps too.
Perl MAY have strong typing, but it would certainly be optional.
Faster than C ? You realize that perl was written in C. It might be faster in text processing if compared to some naive C code but that's pointless. In efect you are comparing algoritms which of course has nothing to do with C vs Perl.
Only if you are 13 years old, and still giggle when someone says 'tits'.
--
Actually, effect may be used as a verb. It means "to cause to happen". For example, one can "effect a change" to make a change happen.
If it works in theory, try something else in practice.
I enjoy perl at times when bash gets too long or slow, and when C segfaults because I'm playing with strings too much. Perl can handle both arithmetic (which bash has to do special, and annoyingly) and powerful string manipuilation, and I like the opportunities the builtin data types allow, especially the hashes.
:-) So I learned perl and rewrote it, and it works as fast as finger does, even though I'm probably not doing things very efficiently (I know I should use some pipes and fewer system() calls).
I learned perl after writing a huge iterative perl script that colorizes finger based on graduating class of a user. The home directories on my school's machine are sorted by class, so I used that information. The script was incredibly slow, bottlenecking from tons of cuts, ifs and inaccurate greps, but was good for diagnosing periods of high system load, then it wouldn't even run
# debian/rules
oh good God, you are not cut out to be a Perl coder. Let me get this straight: in addition to readability/maintainability, portability, and performance, you value modularity and reusability? Just where do you get off questioning the great Larry Wall?
--Enoch Root, the Human Karma Torch
Why put a comment next to it? Why not in the regexp?
.* (?# Match anything after them)
s{
< (?# Match the beginning of the tag)
(?!$okay_tags) (?# Match all non-ok tags)
?> (?# But only until the first >)
}{}gxi;
Most likely there will be pragmas that turn on the new syntax.
For example.. The new regular expression package can only be used by typing
use re;
Most likely there will be a requirement to say
use 6.0;
To make sure of the new engine. The older engine will probably be linked out for use in compatibility scripts. For example. the use of '&' in a reg ex makes the entire perl engine react differently; Likewise, finding a module that makes use of the new syntax would affect which interpreter / library is loaded in memory.
I hope that they find a clean way of doing this. A rewrite really should not feel like bolted on code.
-Michael
what don't you like about hungarian notation? I'll bet you don't even know it.
WWJD? JWRTFM!!!
Seriously, /why/ would you want to do that?
Because I can't code an attractive and usable UI to save my life, but I can specify the database interaction and function of a page. That's why.
--Shoeboy
it is possible that it's the price of power and expressiveness: perhaps nobody can invent a language that does as much that does not come out looking ugly and unreadable. But that does not alter the fact that Perl is ugly and unreadable.
There's a reason for that. Larry Wall is in fact Weird Al. Same shirts, same glasses, same silly grin! I bet you've never seen both of them together. Al is Larry with a wig.
Actually, Larry's homepage isn't unknown. It's here.
Well, actually the hard part about the above is the regex, not the perl. In fact, the only part of the line that is perl is "$okay_tags" and perhaps the ";" at the end. The rest comes from the wonderful world of line nois^W^Wregular expressions.
Perl also makes regexs *easier* to read, and it allows you to do things like split up a regex onto multiple lines and so forth...
HTH
are you kidding? it's "affect", not "effect".
Actually, Perl 5.005 allows typed variables. I tried designing with it, and it really gets combersome.
# Class A; Class B inherits Class A
my A $obj1 = new B;
my B $obj2 = $obj1;
I liked it because of the supposed optimization of the pseudo hashes, but I found myself typing 3 times as much to do incredibly simple tasks. Personally I like building OO libraries ( makes my work easier down the road ), but the "bolted on" perl OO model takes a lot more work when an attempt is made to be clean and concise, which you need to do every now and again.
That said, I definately agree with you about how powerful perl is when it comes to data manipulation such as in databases. I can throw together a complete CGI/DBI web site in minutes, for prototyping, then go back later and structure all the function calls when there's time.
-Michael
-Michael
It was unofficial, and it sounds like it's going to be (somewhat) abandoned.
WWJD? JWRTFM!!!
I think they should call the new Perl version gperl2, just so they can follow suit with the confusing libc5->glibc2 shift.
Hey, no fair! Firstly, I'm not a Python zealot. I don't even really know Python too well yet.
My point was, I just don't find Perl to be particularly aesthetic, and was wondering if anything is going to be done to fix that in the rewrite...
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
The camel was chosen as the cover animal by O'Reilly (www.ora.com) for the first 'Programming Perl' book.
--
Grand prize in most well-rounded in confusion (1986/wall.c)
Most Useful Obfuscation (1987/wall.c)
From ioccc.org
And you people WONDER why it's hard to read PERL code?
And yes, I have written readable PERL code. I have also written a regex script to parse my VB code and alter function parameters as a global find and replace... If you can't read regex, you won't be able to read well written PERL code that uses it. I find that most people who accuse PERL of being dirty and hard to read simply can't read regex.
Network Security: It always comes down to a big guy with a gun.
The way I see Perl is that if you have a messy mind, you'll create crappy perl. If you've got a focussed mind, you'll create focussed perl. You impose the discipline on perl, it doesn't impose the discipline on you. It's the most direct and natural way I've ever seen for transferring thoughts to real code. (Painting By Numbers doesn't count).
This is a good point, well received.
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
I welcome it.
As another aside, I'd say this is a Good Thing (tm) for those of us that have to admin PC's running Linux, Solaris, Win2K, WinNT, and Win98, Sun boxen, and Mac's all in the same campus. That's the advantage of Perl. And thanks to M$ for finally supporting something that someone else wrote without trying to take it over. They should get credit where credit is due.
Depends on what you mean here. I use PHP scripts to present information drawn from my mysql database as webpages definitely. But I also use it to publish static html pages, create text files, ftp files from one server to another, verify data values in my database etc - all tasks that could have been done in Perl (and perhaps more effectively) but which I have done using PHP simply because I am more familiar with it than I am with Perl. In this sense, it is a competitor with Perl, in the sense that most sysadmins will not be writing their maintenance scripts in PHP, no it is probably not in competition with Perl.
Overall I find PHP scripts are easier to decipher when you return to them 6 months later to make a change, I think it has a simpler syntax and some very logical improvements over some aspects of Perl, and for these reasons I prefer it. Mind you there are some older scripts written in Perl that I still occasionally have to tweak, but most of these have been replaced by PHP scripts whenever the need arose.
"The first time I got drunk, I got married. The second time I bought a chimpanzee, after that I stayed sober" Arian Seid
Yes, I realize that PERL was written in C. I also realize that nasm (the assembly compiler) was written in C, and that C itself was written in C.
Still, Slashdot did post a "benchmark comparison" study a couple months ago, which found that text parsing "as written by experienced, competent programmers" in C didn't hold up against Perl's text parsing.
I agree that it's a little weird to benchmark something against its parent. Maybe what they meant is "PERL handles text better than YOU."
"Beware he who would deny you access to information, for in his heart he deems himself your master."
Disagree. Even though I don't know French, I could get the general idea out of the French sentence. The Perl code looks like someone put both palms on the keyboard and pressed a bunch of keys. :)
Will perl 5 source be 100% ok with perl6 or will i have to rewrite code?
The impression I get from the article is "mostly compatible":
So while the focus of the effort seems to be on improving the Perl guts and API, the project will also be used as an opportunity to clean out some of the cruft, including bad and seldom-used features.
You'll probably be ok, but no promises, assuming they don't change their minds during the next year or so (remember, they're just _entering_ the planning stage now).
whoops! of course, at a glance I saw the parenthesized word, not the alternative. sorry.
I chose that as an example of "incomprehensible" Perl. But it's only incomprehensible if you don't know Perl. In Perl, all regexps are read from left to right.
:).
So if you're trying to read mine, you should first check out the first character: "<". It's not a metacharacter - it's an angle bracket. Why? Because this script dealt with HTML. Next bit: "(?" When you see the '?' after the '(', the manual says "you should stop and \"question\" exactly what is going on."
Then there's a "!" to give meaning to the "(?". Everyone knows that ! means "not". And that should give you a fair idea of what's going on - we're trying not to match something. It's a little more complex than that, but that's because it's got a complex job.
OK, next bit: A variable - containing what we're trying not to match (in this case, the descriptive variable name tells us that we're not matching okay tags. The "<" (earlier) tells us that we're matching some tags, so it must be the not OK tags). If you had the script in front of you, you would see that the variable was in the form foo|bar|baz|fred|barney. So, there are a bunch of okay tags we're trying not to match.
Next bit: ")". Emacs will tell you what it matches (in case you couldn't tell yourself).
Etc. I did the hard part, you do the rest
Before I saw this, I assumed that the job (the sub Police_html) would be done with a traditional parser. For an exercise, I tried to write one... My buggy parser (it let <blink> through if <b> was allowed) was around 20 lines, in more-or-less C programming style - no regexps. It was no more readable, and it didn't do the job right.
Perl lets you do things quickly and easily that would be ugly and long with other languages. If you think the above code is ugly, don't compare it to the English "Remove all HTML tags not on a whitelist", but to the equivalent C.
-Dave Turner.
Become a FSF associate member before the low #s are used
Over the years, I've hacked around in Perl, never really caring much to fully learn it properly in the same way that I've learned C/C++/Java and more recently, Object Pascal (Delphi). I've got 4 pretty good Perl books on my shelf, and haven't really even bothered to get more than a few pages in ... using them mostly as references for when I inherit a Perl project from some other poor soul.
... I guess however, that this rewrite will address the engine more than the language itself, no?
It always comes off to me as being a sort of a 'dirty' language in that there are about a kajillion different ways to do the same thing - and I've never much cared for the way variables are declared and used in Perl (scalars?). Too much use of symbols, not enough grammar.
The limited Perl I have written has filled me with nothing short of a maniacal desire to become a darned good Python programmer.
I understand that Perl ties a lot of the web together, and it definitely has its uses, but my initial reaction to the news that Perl was getting a rewrite was "about time, coz it's a gnarly language"
What language-based improvements will this rewrite address, any of you Perlverts know?
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
Oh, sorry, that's C. C++ can't use C, can it?
WWJD? JWRTFM!!!
He announced his vision for Perl 6. Please try to keep the headlines from being completely misleading....
There's nothing inherently Wintel-specific about COM or DCOM, it's just that that's where 99% of it happens to be implemented. I have a COM-freak friend who gets trigger happy whenever anyone talks about COM as being MS-specific. "It's publicly documented" he begins to froth...
I will CRUSH you and your stupid, plastic,
transforming toys!
The article clearly states that a preview version will be available some time NEXT summer.
Not even all the modules are upgraded for me to use in 5.6 yet.. let alone thinking about Perl 6.
Sorry, but the article title et al. are rather misleading, guys. How about 'Perl 6 Dev Plans announced' instead?
Check out Magic Firesheep!
I'm just starting Perl (~chap#2 O'Reilly) and I don't have a clue what your Perl statement says. Mind you, I could have a stab at the French translation: a phrase in French is difficult to translate in English - and my French is worse than my Perl :)
:)
How about a little experiment: let's have an experienced Perl hacker write a paragraph in obfuscated Perl and also a paragraph of almost random alphanumerics. Then we could have a straw poll of non Perl-learners to see if they can recognise which is which
When will the COM+, SOAP, OpenGL and ASP+ support enter beta!
The Mongrel Dogs Who Teach
If you need perl on a rescue disk, you can replace the commands with perl scripts (since perl is there anyway) and save some space.
And yes, I know I'm reaching.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
How are namespaces one of the 'good things'?
"It's tough to be bilingual when you get hit in the head."
Nothing wrong with that as such (or perhaps I should say "per se"...)
Amen!
This is a plug for Icon. You can do everything you can in Perl in Icon - with sane and human-readable syntax. Things are slightly different there; see the article from the Linux Journal.
To download this object-oriented, very high level language with garbage collection, X11 support, POSIX stuff (networking, file/directory manipulation etc.) go to the Unicon web page. It is available for Unix (Linux, FreeBSD etc.) and Windows-NT. It is, of course, free.
-s
Unlimited growth == Cancer.
I always thought the lack of grammer and use of symbols made Perl code cleaner, more compact.
Also, I always thought it was strange that Perl ties so much of the web together. I think this happened just because a lot of early web enthusiats were good perl programmers, not because it's specifically good at the job. Perl is good for CGI.. but I don't know why anyone make a Perl web server. Does anyone know if mod_perl/PGP is quick for running sql querries and pulling back the data? I'm sure it's fantastic for parsing the results, but I'd think a C interface to the data would be quicker.
you could more accurately say that CGI has been losing its reputation as the best (or normal) way to do dynamic webpages, and *that* is a great thing in itself, since CGI (one fork/exec per page, yay!) sucks rocks. Perl has very good support for the CGI model, wiht the CGI.pm module, and mod_perl for Apache has two very good CGI emulations (Registry and PerlRun, with different tradeoffs in how much faster they are, and how much cleaner they require your code to be). However, emulating CGI is *NOT* the only, or the best way to use build dynamic pages with Perl.
The web-dev world has already pretty much come to the conclusion that URLs must be mapped to their content, not to a directory of scripts. As usual with Perl, There Is More Than Way To Do It; you have modules to embed stright Perl code into html pages (Embperl), modules that implement a higher-level componentized model (HTML::Mason, Apache::ASP, the Templating Toolkit, and others), and buzzword-compliant modules that go the XML/XSL way (AxKit).
As for perl6, I don't think it'll have a very direct impact in the way people do web development with perl. Perl 6 is going to be a complete rewrite and cleanup of the language, possibly with changes as fundamental and far-reaching as those between perl 4 and perl5. It will reorganize the whole perl world, not just the "perl on the web" part of it.
What benefit is there to having all the Unix commands written in perl?
The advantage you cite:
has more to do with Perl's low-level support for complex types - in this case, tuples. In Java you need to pull in, one by one, fine-grained data objects. In perl, as you note, you can just pull in a tuple of (id,fname,lname), and reference the members of the tuple individually.
This is not to say that you should be creating var names on the fly.
use strict
But there are cooler things that perl could be doing with typing. What you desire is a glue language - Perl's great for that. If we did more complex typing (dynamic checking of tuple size & types), then Perl would be even more useful as a large-scale development language.
This should be interesting to watch develop. Since this one is going to be design by open source, I wonder if they'll ever be able to release an upgrade.
It seems that the past has shown that language by committee ends up over-burdoning the language. Are they're any previous examples of language design by committee that worked? It seems that all of the successes programming languages have made have been because of one or two evil geniuses who were able to see a project to completion, design to code.
I wonder if it's just revisionist history, but weren't c, c++, python, perl, and tcl all works of very small teams (excluding the standardization committees).
This should prove to be a great example for university programming language courses.
-js
Go python, does anyone notice that Perl 6 is going to borrow a lot of things from python? Another score for python! :-)
Time does not wait.
Just out of curiosity: how many perl programmers here upgraded old perl scripts to use Perl 5 features when Perl 5 came out? I know that where I work, most scripts are run with perl 5 but are written (with the exception of the occasional chomp) in Perl 4 syntax. Are people fully utilizing new functionality?
I'm always paranoid that when someone prunes a language they'll take out something I always use. I hope those guys are careful. How about a slashdot poll, What's your least-favorite perl function?
Joke responses:
* making it into jewelry
* CmdrTaco can't type! haha!
* (number of choices) + 1
# debian/rules
A rewrite of Perl would be nice, as long as compatibility could be addressed. I imagine that in the new version there would be some compatibility glitches to work out.
Either way, as cool as Perl is, I know (and I'm sure everyone else knows too) that there are parts of the code that could be optimized in the rewritten version.
I'm curious. Maybe a few cool new data processing functions could be added too? I know There's a couple of array functions I wouldn't mind that are present even in VB! Kickass.
I believe your example could be written much more clearly. This:
s|<(?!$okay_tags).*?>||gi;
should do the same thing, and is more readable. You can make any language obfuscated, especially when the language is flexible.
I mean, honestly, can you think of a faster way to "zap all html tags not in the list of ok tags"? It may be a little hard to read when you are done, but if you put a comment next to it saying what it does, it's not hard to understand.
Got HTML? Want LaTeX? Try html2latex
s|<(?!$okay_tags)[^>]*>||gi; is faster
Yeah. That just proves my point. Perl text processing libraries use optimized algoritm (written in C of course)
O'Reilly is funneling massive kick backs to Larry Wall in exchange for making millions of O'Reilly Perl books obsolete. This way they get to "totaly rewrite" the books and sell them to you again all over again. Think of the children!! ;) Or something.
This sig is false.
You are a great man, indeed!
String ssn = rs.getFloat(4);
float cash = rs.getString(1);
These are the errors? You're still thinking in Java if you can't see that the perl equivalent would simply be
($ssn, $cash) = @results;
which presents no float / string conversion problems.
in Perl this error will be allowed to silently propagate through the system causing wasted time later glancing at line-noise-like syntax trying to track down a bug that is due to the typelessness of the language.
The only way this bug (confusing the order of results returned by the SELECT) will creep up to get you is if you don't unit test your methods...
Microsoft gives money to ActiveState to make Perl work better on Windows. ActiveState employs some key, core perl programmers.
I think the perl 6.0 rewrite will be beneficial for the perl community. not only in terms of organization, but also to help perl hold on to the cgi market. with all the other options, php, et. all, it has been my impression that perl has been slipping.. losing its position as "the best for cgi" not that that's a bad thing.. by any means.. i'm glad the others have come into being to challenge perl, because that challenge will end with (1) perl becomming even better, or (2) perl yielding to one of the challengers. religious affiliations aside, both of those endings mean better things for cgi programmers everywhere.
Will the real Richard Stallman please stand up?
I see what you mean, all i'm saying is not everyone needs their first taste of perl to be incomprehensible. I've been writing perl scripts since perl4, therefore i understood your example, but why shouldn't we bring in rookies with lighter scripts?
I'm also a big proponent of PHP. Everyone i show php to comments on how easy the syntax of the language is and how easy it is to just basically code with it. All i can think afterwards is "If you like and understand PHP, then you'll like and understand Perl". But this wouldn't happen if i showed them some fsck'd script i've written that uses the most confusing methods of doing things in PHP.
all i'm saying is let's try to bring the rookies in a bit slower, just so people don't end up running to python because they think it's easier (when in fact that strict spacing thing sucks).
This is kinda off-topic, but I remember about six to twelve months ago that some people were going to rewrite all of the Unix commands (cat, ls, chmod, and others) in Perl. Has anyone else heard of this project? Does anyone know what happened to that idea? I thought it was interesting, at least.
Prevent email address forgery. Publish SPF records for y
I have avoided learning Perl for a couple of reasons. One of them (not the most important reason, obviously) is that the syntax looks vaguely like a memory dump. You know that Dilbert joke where Dilbert instructs Ratbert to dance on the keyboard so that Dilbert will have more bugs to fix, but in doing so Ratbert creates a web browser instead? I think it was written in Perl.
I'm really hoping Perl 6 will give us some more readable syntax. Hey, I like my C++ short and terse too, but I don't care for entire subroutines mostly written in punctuation.
Yeah, I know that syntax is a lame reason to like or not like a language, but I'm the one who has to stare at it. It's the little things that make the difference.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
Get your daily Perl news shot at Nandor's site http://use.perl.org