×

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

Thank you!

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

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

What is Perl 6?

ScuttleMonkey posted more than 8 years ago | from the it-all-started-with-a-camel dept.

Perl 343

chromatic writes "Perl.com has a new article entitled What is Perl 6?. It analyzes the changes to the language in light of the good and bad points of Perl 5 and provides new information about the current state of the project: Perl 6 exists, you can write code in it today, and it's more consistent and easier to use than Perl 5."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

343 comments

What is Perl 6? (2, Insightful)

eldavojohn (898314) | more than 8 years ago | (#14488518)

What is Perl 6?
Probably a pretty good sign I should get off my ass and spend some time learning the language if I don't want to become obsolete to my employer.

Yeah, I know I'm late to get on this but ... well ... my personal needs and job have never forced me to use it.

Re:What is Perl 6? (5, Interesting)

Perey (818567) | more than 8 years ago | (#14488555)

That's the thing, though. PHP is the big name (from management's perspective), at least in the P category of LAMP, right now. Not that Perl's gone away by any stretch of the imagination, but the existing Perl shops are happy to keep on doing what they're doing, while the PHP advocates crow about how many new jobs are being done in their language.

So is Perl 6 going to bring about a Perl revival, or is it (as I suspect) going to fall flat when faced with Perl 5's quietly entrenched support and PHP's proclaimed grip on new uptakers? TFA mentions the reasons for cutting backwards compatibility (or at least reducing its priority) far too often for me to be optimistic there.

I think Perl 6 will catch on, eventually... but it's going to be more of an alternative language, not an upgrade, to Perl 5 for a long time yet.

Re:What is Perl 6? (0)

Anonymous Coward | more than 8 years ago | (#14488661)

perl 6 is an absolute waste of time....

Go with the strength.... Go with .NET!

Re:What is Perl 6? (2, Interesting)

slashdotnickname (882178) | more than 8 years ago | (#14488662)

Probably a pretty good sign I should get off my ass and spend some time learning the language if I don't want to become obsolete to my employer.

I'm sure if your employer starts needing perl solutions, they'll buy you a book. It's not that hard to pick up if you come from a programming background. I once got tasked to modify a perl script, and was able to learn enough perl to get the job done within an afternoon. Been a fan of it ever since!

Err? (2, Insightful)

LordMyren (15499) | more than 8 years ago | (#14488790)

Normally you wait until a language is actually released before learning it. Traditionally, you let a couple early adopters build something with it first too. Most smart organizations wait to make sure the langauge actually is somewhat stable before buying into the list of benefits. They wait for books to be released.

Perl6 is not really here yet. Read the last page. Author doesnt come out and state it directly, but the current best implementation runs on Haskell.

I dunno, somehow I dont think the take-away was supposed to be "learn this or get fired, parrot is the one vm to rulezor them all!!11," I think it was more "perl6 is still coming and has some really cool new features, as well as being built around a much more solid core." There's mainstream technologies worth reading up on if you feel the heat to stay up to date for your job. Then there's things like Perl6/Parrot; cool technologies to read up on if you're actually fucking interested in computer languages or vm's. Forgive me, I realize you simply werent aware of the status of perl6, but perhaps you should see how many band members are actually on the bandwagon before hoping aboard yourself.

Myren

unfortunately (5, Funny)

caffeinemessiah (918089) | more than 8 years ago | (#14488527)

You can never be told what Perl is.
You just have to see it for yourself.

sorry, i just had to.

Re:unfortunately (1, Funny)

EnsilZah (575600) | more than 8 years ago | (#14488569)

Heh, yeah.
And once you see what the code looks like, you'll be willing to betray your friends and family to forget you ever knew about it.

What is perl? (5, Funny)

Anonymous Coward | more than 8 years ago | (#14488536)

Baby don't hurt me,
Don't hurt me
No more

Re:What is perl? (0)

Anonymous Coward | more than 8 years ago | (#14488679)

Larry don't hurt me,
Don't hurt me
No more

Re:What is perl? (0)

Anonymous Coward | more than 8 years ago | (#14488688)

go home

Re:What is perl? (0)

Anonymous Coward | more than 8 years ago | (#14488695)

This is Slashdot, we're more than likely at home.

how bout a perl necklace on Taco (-1, Offtopic)

Anonymous Coward | more than 8 years ago | (#14488544)

Rob "CmdrTaco" Malda stepped off the bus and was led into the yard of the Main State Correctional Institute. He had been given ten years for participating in a stock fraud. Five with good behavior. Years spent basking in the glow of a CRT had been hard on him. His body was frail, his skin pallid. He knew he could never make it through ten years in the general population with his virginity intact. He had to get into solitary. As soon as the burly guard unshackled him he made his move. Exhaling a feminine "hmmph" he weakly slapped the guard. He was quickly taken to the ground, receiving a swift kick to the ribs before being restrained. As he was dragged to the solitary confinement cell he felt nothing but relief. "At least in solitary," he thought "I'll be safe." Unfortunately for Rob he had picked the wrong guard to mess with. The next few days were uneventful. The time in his cell he spent evenly between sleeping, reading a "Perl for Dummies" book he had gotten from the book cart, and masturbating furiously. His self-flagellation was interrupted on the fourth day. The burly guard he had attacked earlier stepped into his cell. The gleam in the guards eye and the mean grin on his face made Rob's pecker quickly shrivel in his hand. "You fucked with the wrong man when you fucked with Michael Simms," said the guard. "The inmates here call me The Asshole for a reason. Now come with me, punk." The guard led him down the hall to one of several empty shower stalls. He roughly threw Rob in the stall and locked the door. Rob was petrified. His mind raced as he imagined the myriad of different tortures that could be in store for him. His worst fears were confirmed when the guard returned. In his hands were a short black dress, black stilleto heels, and a curly blonde wig. "Strip down and put this on, bitch." Rob did as instructed and was pleased to notice that the dress fit well and the heels gave him a nice slimming effect. The burly guard admired the drag queen. "The GNAA is gonna love you!" The guard left the shower stall, only to return minutes later. He opened the door and led 20 large black men into the stall. "Rob, meet the Gay Nigger Association of America. GNAA, meet Rob. I'm sure you all will get along fine." With that the guard slammed the shower door closed and walked away laughing. The men approached Rob, backing him into a corner. The apparent leader stepped forward. "No matter what I'm gonna fuck that purdy lil' ass of yours. Now I can fuck it dry or you can lube it up for me." Rob knew he had no choice. He kneeled in front of the leader, who began to slap his face with his 10 black inches. Puss from syphilictic sores quickly covered Rob's cheeks. When the leader was sufficiently aroused he placed his throbbing cock up to Rob's lips. As soon as Rob opened his mouth the leader violently shoved his manhood to the back of Rob's throat and exclaimed "Swallow my shit you cracker bitch!" Rob gagged as he was violently face fucked. Just when he was about to pass out the leader pulled out, turned him around and shoved his cock into Rob's ass. Rob began to scream in agony but his cries were quickly muffled by one of the other gang member's cocks. They rode him like that for the better part of an hour. When one man finished another quickly took his place. Just as Rob was getting used to the throbbing pain in his anus the men stopped. One man lay down on the floor and Rob was told to get on top of him and take his dick inside him. Exhausted and humiliated, Rob had no will left to fight. As soon as he inserted the penis another man came up behind him and began to force his cock into Rob's already filled anus. Again his screams of agony were muffled, this time by a smelly black anus. For another hour he was violated in this way. When the men were finished with him he couldn't walk and his mouth was filled with dingleberries and ass hairs. Before they all left the leader had some parting words for Rob: "Thanks for that sweet piece of ass, punk. We'll see you again tomorrow. Oh by the way, we all have AIDS." It was going to be a long ten years for Rob.

TFA (1)

Mrs. Grundy (680212) | more than 8 years ago | (#14488548)

Well that will teach me to RTFA. One of things that got me interested in programming, and perl specifically, was the magnificent writing in the Camel and Llama books. It made it seem fun, relaxed and reduced the shock of the sometimes difficult syntax of the language. Hopefully this deadly boring article is not a sign of what Perl 6 documentation will be like.

Q: What is Perl? (-1, Offtopic)

Anonymous Coward | more than 8 years ago | (#14488551)

A: Perl is dead.

No language that I like better (5, Interesting)

BadAnalogyGuy (945258) | more than 8 years ago | (#14488560)

I never really understood Data Structures until I learned Perl. I was consistently and thoroughly confused in my DS class. The language used there was C++. There was simply too much baggage in the language that obfuscated the very points we were being taught. If you can't get past the template syntax, how in the world are you going to be able to understand the data structure concepts?

Then I met Perl (5.003). What a difference it made! The data structures were built in, and on top of that, it was EASY to nest structures to build complex data types. It was like having a semester of Data Structures immediately made clear.

Then I found myself back with C++ again. First I wrote my own List classes. However I soon realized that STL made available exactly the types of data structures that Perl has. Maps, Lists, Vectors. And since I understood what I was doing in Perl, it was so much easier to catch on with C++.

Perl taught me C++. Who would have thought?

Re:No language that I like better (5, Funny)

patio11 (857072) | more than 8 years ago | (#14488622)

Perl taught me C++

Somewhere, a maintenance programmer just slit his wrists.

Re:No language that I like better (0)

Anonymous Coward | more than 8 years ago | (#14488784)

hilarious. a gem.

Re:No language that I like better (2, Insightful)

HermanAB (661181) | more than 8 years ago | (#14488666)

Perl seems to be every Unix hacker's favourite, most hated, language. It fills the huge void between Bash and C.

Re:No language that I like better (1)

Lisandro (799651) | more than 8 years ago | (#14488731)

Perl is a REALLY sweet language. The only thing that i don't like about it is its poor OOP support - i always preffer to code the "old fashion" way (to the point i even dislike objects), but right now i'm working on a proyect sposored by my university, and trying to model a large network using object-oriented code is quirky on Perl, to say the least.

    Other than that, i really like it. It's easy to write, runs really fast for interpreted code, and and it's extensible as hell (CPAN [cpan.org] ). Great for scripting!

Re:No language that I like better (0)

Anonymous Coward | more than 8 years ago | (#14488787)

I've been programming in Perl for about a year now, and I know C pretty well, but I've never been able to grok OOP. Those stupid analogies about objects get in the way. Can you recommend a resource for OOP with Perl?

Re:No language that I like better (4, Informative)

Lisandro (799651) | more than 8 years ago | (#14488807)

Can you recommend a resource for OOP with Perl?

Right now i found all i needed in the Perl.org site - this OO tutorial [perl.org] for Perl is pretty complete. There's also this one [perl.org] , which is oriented to begginers.

    In fact, i always keep a browser window open to Perl.org when i'm coding Perl - the tutorials are very nice, but the function reference has been priceless to me.

Re:No language that I like better (3, Interesting)

AuMatar (183847) | more than 8 years ago | (#14488831)

Ignore the analogies, OOP has nothing to do with obkects at its core. OOP is basicly encapsulation and interfaces. You design your program so that its broken into parts. Each part handles one bit of functionality- networking, or database communication or the like. Each part is self contained, no 2 parts should know how the other part is coded- they only communicate with each other through a set of functions. These functions are called an interface. The functionality of each part is said to be encapsulated, because the actual design of the code is not known to the outside world.

In C, you do this with functions in a .h file and call it a library or a module. Sometimes you use a struct to pass around data. A great example is the stdio library- you have a bunch of library functions to do IO. You don't know how those are implemented. ANd since you can have open IO on more than 1 file at a time, you need a bit of data to hold the state of an IO. Thats why you pass back and forth FILE* parameters.

In C++, you put the data and the functions together in one package and call it a class. Think of a class as a C struct with a bunch of function pointers in it. So instead of calling myfunction(mystruct) you call myclass.myfunction(). Its conceptually the same (in fact, the machine code is almost identical).

By now you should be thinking "damn, that sounds like what I do in C already". It is. Good C programmers did OOP before OOP was a buzzword. languages like C and Java just add some syntactic sugar like inheretance (one of the most abused language features ever, especially in Java) and autoatic constructiors and destructors into the mix.

Re:No language that I like better (-1, Flamebait)

Anonymous Coward | more than 8 years ago | (#14488762)

Ouch!

If you're too dumb to understand C++ right away, then for god's sake don't study CS! There's so many interesting things, it doesn't have to be computers, does it?

Re:No language that I like better (-1)

Anonymous Coward | more than 8 years ago | (#14488799)

Europe to Officially Induct USA into EU

16/01/2006 Yur O Trasch

In his latest speech outlining his administration's latest plans to deflect his failures, French President Jacques Chirac focused on his grand initiative to make the USA a permament member of the EU, although with no voting privilges.

Chirac said that rather than try and recreate all the various technologies that the USA has, such as Googe, Microsoft, Intel,GPS, etc., making them a permanent member of EU will give all Europeans access to these technologies without spending money that could be better spent on idle French farmers or 45 year old German retirees living in Califonia.

"What Frenchman cannot hold his head high when using Google to search the internet...as long as he doesn't search for Nazi memorabilia", said Chirac. "What Belgian will not kiss the EU flag when he realizes that GPS is now a European technology?"

The ambitious project is still in the early stages of discussion and has not yet been presented formally to the USA.

What is what ? (0)

Anonymous Coward | more than 8 years ago | (#14488561)

Java, Python, Ruby ... but who cares about Perl now but for regexp ;-)

New Perl excitement (5, Insightful)

ChrisDolan (24101) | more than 8 years ago | (#14488580)

What makes Perl strong, in my opinion, is the community's interest in maintaining a large and well-tested library of useful code in CPAN. Without CPAN, it's not clear that Perl would be as alive and healthy as it is today.

What Perl 6 offers is a rejuvenation of the language. Perl 5 still works great (better than ever due to new efforts to stamp out even the most obscure bugs) but this new revision is attracting some *really* smart people who are bringing interesting new ideas to the language. Audrey Tang and Luke Palmer come to mind right away.

My greatest hope, however, is not that a revitalized Perl will squash the other dynamic languages (Python, Ruby, PHP, ECMAScript, etc) but will instead bring them into a state of interoperability. I really, really want Parrot to succeed so well that the other languages decide to target it as a backend so I can trivially call Python or C libraries from Perl and vice versa.

Re:New Perl excitement (1)

Coryoth (254751) | more than 8 years ago | (#14488739)

My greatest hope, however, is not that a revitalized Perl will squash the other dynamic languages (Python, Ruby, PHP, ECMAScript, etc) but will instead bring them into a state of interoperability. I really, really want Parrot to succeed so well that the other languages decide to target it as a backend so I can trivially call Python or C libraries from Perl and vice versa.

I'm really looking forward to Parrot as well. It has the potential to unify Perl, Python, and Ruby in a very nice way - the languages all keep their distinctive qualities, but anyone has access to all the wonderful libraries available for any of them. Moreover, it opens the door for new scripting languages: where before a new language had to manage to rally enough support to get sufficient libraries developed they can now hook into Parrot and get instant access to the richness there. For instance I very much like the look of Amber [xamber.org] as a scripting language with maintainability in mind. More choices is a good thing.

Jedidiah.

Re:New Perl excitement (1)

chhupa_rustam (875206) | more than 8 years ago | (#14488811)

Dude, .NET already does this. Get over your fears of M$ monopolies and just use it! What people should be spending time on is Mono -- make that a worthy tool, and we're set.

Re:New Perl excitement (1)

chromatic (9471) | more than 8 years ago | (#14488821)

Mono has lingering patent questions. Parrot doesn't. That's a strong point in favor of Parrot.

Hear me True Gods of Interoperability (1)

LordMyren (15499) | more than 8 years ago | (#14488837)

Interoperbility is a great idea. I'm not sure if I buy unification though. Parrot might make a wonderful VM, but I simply cannot imagine it'll be able to stand alone. dotnet's virtual machine is fine, but it was clearly limited in scope and for all they the alternative dotnet languages just cannot overcome many of the static (v. dynamic) language limits built into the VM. Everything I read about parrot seems to indicate that it'll be a hundred times more dynamic, but I just cant picture anyone making a VM, what was the articles stupid word, oh yes, manipulexitious enough to be everything to everyone. Either the VM is abstract and the languages running on top of it have to start defining additional limitations to build functionality and we loose interopability, or the VM is overly rigid and people have to build something else.

Look at the modern langauges. Python is wonderful because its a wonderful scripting engine for C code, complete with eight hundred types of glue. Classpath is interoperable java. Dotnet can PInvoke normal libraries. Languages arent converging, they're interacting. Best of luck, please, oh please do your best to try, but I just cant imagine any being, god or man, making a VM so flawlessly unconstrained and yet utterly unifying that it can become everyone to everything.

More scripting languages built around an interoperable core would be delightful. But already there are far far too many libraries which have to be rewritten for each platform. How many SAX parsers need to be written, how many SOAP libraries, how many SAML parsers? Every language needs it own, and thats a crying shame.

What now? Do we go web services crazy and a SAML parser in Java as a web service for a dotnet application? Doesnt that seem a bit batty? Or do we break open IKVM and wholesave import the couple dozen of java libraries opensaml requires into dotnet? Every single protocol and xml-namespace faces this same barrier; what language do we build the interpreter in? how many times will we rebuild it?

My plea? Make Parrot truly interoperable. Not just by trying to bring the joyous miracle of parrot to every existing langauge concievable, but by interopting with the existing language ecosystems.

Myren

Re:Hear me True Gods of Interoperability (2, Informative)

chromatic (9471) | more than 8 years ago | (#14488847)

That's what Parrot's NCI layer does. It's a foreign function interface to shared libraries. It's much nicer than Perl 5's XS.

Neat, yes, but It's not pleasant to read... (1)

ShyGuy91284 (701108) | more than 8 years ago | (#14488589)

I used Perl in a Programming Language Concepts course. You can do some neat stuff with it, but it isn't really the easiest thing to understand (at least not with maybe a week or two of going over it). My professor likened it to duct tape. It is a quick fix, that others aren't supposed to see. It works, but isn't pretty, and isn't something you should expect to build a whole program (so to speak for a scripting language) with....

Re:Neat, yes, but It's not pleasant to read... (1)

HermanAB (661181) | more than 8 years ago | (#14488678)

It is mainly the regular expressions that are hard to read and that is no fault of Perl. The main problem is that Perl is always full of regular expressions...

Re:Neat, yes, but It's not pleasant to read... (1)

Schraegstrichpunkt (931443) | more than 8 years ago | (#14488757)

and isn't something you should expect to build a whole program (so to speak for a scripting language) with....

Better Perl than PHP.

Re:Neat, yes, but It's not pleasant to read... (1)

m50d (797211) | more than 8 years ago | (#14488796)

You can do just as full programs in scripting languages as you would in any other, though personally I agree I wouldn't use perl for a big project.

starting from the bottom (1, Interesting)

systems (764012) | more than 8 years ago | (#14488591)

The problem I see with a language like perl6 and mant others, is that it seems they all started from the bottom.

They add features, which already exists in some other language, only they maybe improve the interface, or add any sort of incremental improvement to it.

My problem I see, they didn't start with a dream, which became a vision, which became a mission, which transalted to goals, and then a solid implementation.

If you are already familiar with strategic management, you will noticed I borrowed some terms, from that field. Strategic management suggest that for an organization to succeed, it must have a clear vision (based on a dream a good cause or whatever), a mission (a more realistic translation of the vision/dream) , and finally goals and objective (implementation detail)

So I ask, what's perl6 vision, I think perl6 started with details, this is why me and many others are not existed about it, sure it will better (maybe), but it won't be new, and probably it won't add much to the technology arena.

Re:starting from the bottom (2, Insightful)

free space (13714) | more than 8 years ago | (#14488673)

With all respect to the importance of strategic management, it is only one way to achieve success. Many of the great organizations of today didn't have a vision when they started and made it up as they went along.

Linux began as just for fun, Bill Gates' vision when starting Microsoft was "join the bandwagon as fast as you can before you miss the oppurtunity", and Perl itself started as a replacement for awk.

IMO, you can go either way- top down or bottom up- as long as you're competent enough to see oppurtunity and smart enough to know good decisions from bad.

I have few counter arguments (1)

systems (764012) | more than 8 years ago | (#14488758)

I think Bill Gates had many dreams, and at least one popular and solid vision: "A computer in every house, or Personal Computer". I am not saying that this vision is stricly his, maybe he borrowed it from someone else, or adopted it somehow. But he had one ...

As for Linux, well, Linux didn't really succeed alone, it succeeded as being part of the GNU thing, and RMS obvioulsy had a vision, so (even thought it doesn't have to be true) I can argue that if it weren't for RMS's vision, Linux would have stayed a just for fun thingie. RMS gave linux caliber.

As for what someone else said, that this vision->mission->goals, is a strict system, well, there are several arguments against that.
  • First many people do have visions and missions, but they don't state it, maybe they are shy afraid or don't think its important, but no, communication your ideas and goals are importnat so if you got them, plz, say em.
  • The hierarchy is exactly how the strictness is removed, a goals is specific and precise, its one clear thing, that you either achieve it or not, a vision is less specific and more liberal, take Bill Gates vision for example, it didn't say, that a proprietary OS had to be the solution, it was just one way to achieve it. Take RMS vision, people still argue about the definition of free software, what's free what isn't, so you see
So you see, the strategic system only help people create direction, and decide whether or not they achieved progress

Re:starting from the bottom (0)

Anonymous Coward | more than 8 years ago | (#14488680)

I think in this case the vision is to make a better Perl, that would be more then sufficient to create a solid idea of what needs to be done and from there a solid implementation.

I would also like to note that when you force people into strict systems that they don't tend to do all to well, even if the idea itself seems theoretically sound. This is probably because people hate to be tied down, it just doesn't agree with how alot of people think and do things.

Re:starting from the bottom (1)

l3v1 (787564) | more than 8 years ago | (#14488835)

Gee, are you not working for MS by any chance ? :P start with a dream, which became a vision, which became a mission, which transalted to goals :D Perl is fraggin' cool stuff, has always been, from day one. Not for everything, naturally, but for a lot of tasks a perl-trained hand is mostly unbeatable. Sure as hell the programming world would be a lot poorer without perl.
 

One thing perl is still good for. (2, Insightful)

tuxmaster (851910) | more than 8 years ago | (#14488603)

One thing that perl is good for that I hope it continues to be good for in the future in command line scripting.

Re:One thing perl is still good for. (1)

syzler (748241) | more than 8 years ago | (#14488702)

One thing that perl is good for that I hope it continues to be good for in the future in command line scripting.

What is this "command line" thing of which you speak? I vaguely remember a retiring programmer telling me about using it and other mythical computing concepts such as GPL licensing , POSIX standards and Unix environments, but I always thought they were just fairy tales.

Perl 6 is evolving the language into awesome! (2, Interesting)

Inoshiro (71693) | more than 8 years ago | (#14488618)

My compilers professor has nothing but bad things to say about a language whose syntax is inelegant and tricky. After all, if a language is inelegant, it will be hard to read and understand, as well as hard to create a proper grammar for, or parse.

"(Perl 5 overloaded curly braces in six different ways. If you can list four, you're doing well.)" ! Java has something like 22 levels of precedence. Most people will use the bare minimum of that, lest they tread upon a dragon's tail.

And, one of my favourite points: "Why is the method call operator two characters (one shifted), not a single dot? "

Perl 6 means a simpler, better parser, while keeping all the language strengths. This means it won't be such a bitch to deal with mod_perl's weird gleeps once it's Perl 6. This means smaller process overhead. This means quicker development of web applications that are cool (although I must admit, Ruby on Rails is also pretty neat looking).

The new regex syntax alone is reason to switch!

Re:Perl 6 is evolving the language into awesome! (1)

Schraegstrichpunkt (931443) | more than 8 years ago | (#14488766)

Strictly speaking -> isn't the method call operator: it's the dereference operator. I think & is the method call operator, but it's optional, so nobody uses it.

Re:Perl 6 is evolving the language into awesome! (2, Interesting)

Engineer Chris (891425) | more than 8 years ago | (#14488822)

And, one of my favourite points: "Why is the method call operator two characters (one shifted), not a single dot? "
Because concatenation was already a single dot before method calls were introduced (in perl5).

What is Perl 6? (0)

Anonymous Coward | more than 8 years ago | (#14488648)

Ruby's [ruby-lang.org] ugly second cousin, twice removed.

Re:What is Perl 6? (1)

l3v1 (787564) | more than 8 years ago | (#14488851)

Well, you most probably wanted to say Ruby, Perl's neater nephew. I mean check the dates.

It's when some reviewer said Tron was the Matrix of the eighties.

WHOOPITUPTITUDE! (5, Funny)

reidman (563291) | more than 8 years ago | (#14488658)

From TFA:

Not everyone who starts learning Perl for whipituptitude needs manipulexity right away, if ever, but having a tool that supports both is amazingly useful.

Whipituptitude?!

That is awesome. Made up words a--

Whats this? Manipulexity?

How much awesome can you cram into a single sentence?

Re:The funny thing is... (1)

SolitaryMan (538416) | more than 8 years ago | (#14488860)

... that they all spell that "whipituptitude" differently. Look for yourself:

  • In TFA1: whipituptitude
  • In TFA2 referenced from TFA1: whipuptitude
There must be some disagreement on the concept :)

Re:WHOOPITUPTITUDE! (1)

Mostly a lurker (634878) | more than 8 years ago | (#14488878)

In the English language TIMTOWTDI (there is more than one way to describe it). However, to any Perl advocate, there are there never enough ways that you do not need to add more.

What is Perl 6? (0)

Anonymous Coward | more than 8 years ago | (#14488660)

A horrific obscenity that must be destroyed!!

j/k

My short experience with perl... (3, Insightful)

rsidd (6328) | more than 8 years ago | (#14488664)

Three years ago, I could program in C, but had never used a scripting language (except bash, for very basic stuff). I needed to do some non-trivial manipulation of text files and figured that this was a good time to learn. Since others in the group were using perl, I tried perl.

I knew what I wanted to do, but needed to learn the language. I struggled with the awful syntax for three days. The breaking point came when I wanted a list of lists and realised that Perl "flattens" nested lists. How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]? In Python, it's trivial (that's how you'd write it), but in perl, nobody I talked to could give me an answer. It flattens it, unasked, to [1,2,3,4,5,6,7,8] and, try as I might, I can't see the point. (It turns out it's possible to have nested lists, but it's yet another example of perl's horrendous syntax).

Finally, I decided to give python a try. I spent an hour reading the python tutorial, and in another three hours, I had reimplemented everything I'd done in the last three days in perl, and an hour after that I'd finished the job. Python syntax was, and still is, the cleanest I've ever seen. It's an amazing language. And it changed the way I think about programming: it gave me an appreciation of functional methods (I now use ocaml [inria.fr] a lot) and also changed the way I write C (vastly for the better).

That was it. No more perl for me.

Re:My short experience with perl... (1)

chromatic (9471) | more than 8 years ago | (#14488682)

How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]?

In Perl? Exactly that way. Really, how much did you try?

Re:My short experience with perl... (1, Informative)

rsidd (6328) | more than 8 years ago | (#14488712)

How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]?

In Perl? Exactly that way.

Indeed?
$ cat list.pl
@a = ((1,2),(3,4),5,(6,7,8));
print @a[0], " ", @a[1], " ", @a[2], " ", @a[3], " ", "\n";
print $a[0], " ", $a[1], " ", $a[2], " ", $a[3], " ", "\n";
$ perl list.pl
1 2 3 4
1 2 3 4
$ cat list.py
a = [[1,2],[3,4],5,[6,7,8]]
print a[0], " ", a[1], " ", a[2], " ", a[3]
$ python list.py
[1, 2] [3, 4] 5 [6, 7, 8]
$

Re:My short experience with perl... (1)

chromatic (9471) | more than 8 years ago | (#14488723)

I said "exactly", not "differently". Why'd you replace the square brackets with parentheses?

Re:My short experience with perl... (1)

rsidd (6328) | more than 8 years ago | (#14488725)

Because perl lists use parenthesis, according to every damn doc I've read?

Re:My short experience with perl... (1)

chromatic (9471) | more than 8 years ago | (#14488751)

I don't know if this is helpful to you, but the particular docs that would have helped are perldsc, the data structures cookbook, and perlref, the references and nested data structures documentation. The table of contents, perltoc lists all of the core documentation.

Re:My short experience with perl... (5, Informative)

BadAnalogyGuy (945258) | more than 8 years ago | (#14488870)

This is one area where the Perl docs (as detailed as they may be) fail new users.

Intuitively, a new user would look at the TOC and see perldata "Perl Data Types" and think that the complete definition of the 3 main Perl data types would be described. So rsidd looks for instructions on creating multidimensional arrays, sees "List value constructors" and gets this:

LISTs do automatic interpolation of sublists. ... arrays and hashes lose their identity in a LIST... To make a list reference that does NOT interpolate, see the perlref manpage.


So they head over to perlref (an extra level of indirection) and notice in Item 2:

A reference to an anonymous array can be created using square brackets:

        $arrayref = [1, 2, ['a', 'b', 'c']];

Here we've created a reference to an anonymous array of three elements whose final element is itself a reference to another anonymous array of three elements. (The multidimensional syntax described later can be used to access this. For example, after the above, $arrayref->[2][1] would have the value ``b''.)


But this isn't really easy to understand. Why does he need an arrayref when he wants an array?

@array = [1, 2, ['a', 'b', 'c']];

That isn't the same as what he wants. In fact, it's not what you'd expect from DWIM. It's a single entry array, not a multidimensional array. It's not even a list of lists (unless you perform a little magic on it).

So finally after struggling with this and ending up with some ugly monstrosity like the following:

@array = @{[1,2,\@{['a','b','c']}]};

Now his code works, but it isn't very easy to understand, and the maintainers of this code are going to tell everyone how evil and illegible Perl is because the programmer here couldn't figure out how to make a multidimensional array.

The only FAQ entry with the term "multidimensional" in it refers to some DBM-specific topic that doesn't seem to have any relation to the problem at hand. While "list of lists" may be the preferred term in the Perl community, it would be nice to have a FAQ entry like "How do I create a multidimensional array?"

As you've mentioned, perllol has the exact syntax of how to do this. Unfortunately for our poor programmer, the link to that is buried in the See Also section alongside perldsc (which is large and contains quite a bit of irrelevant information like 'use strict' information, while at the same time not providing very detailed information about the data structures themselves). The very first 'perldoc perllol' page displayed gives the answer immediately:

An array of an array is just a regular old array @AoA that you can get
at with two subscripts, like $AoA[3][2]. Here's a declaration of the
array:

        # assign to our array, an array of array references
        @AoA = (
                      [ "fred", "barney" ],
                      [ "george", "jane", "elroy" ],
                      [ "homer", "marge", "bart" ],
        );

        print $AoA[2][2];


Why is it so hard to get to this simple explanation? Why should a neophyte have to go through two documents to finally get to perllol? The FAQ should describe the technique using "multidimensional" as a keyword.

I love Perl, and I love the depth and breadth of the Perl docs, but they are difficult to navigate for Perl neophytes.

Re:My short experience with perl... (1)

lachlan76 (770870) | more than 8 years ago | (#14488760)

Have a look at the perlref(1) man page. Square brackets provide a list reference. Python does this automatically because it's a reference-oriented language, while perl provides values. In response to your other comment, perl uses a @ for lists, but you have a reference to a list, not a list.

Re:My short experience with perl... (1, Informative)

cliveholloway (132299) | more than 8 years ago | (#14488755)

Yes, indeed. So you change the arrayref of arrayrefs in your first post to an array of lists in the parent code and wonder why it doesn't work?

Let's assume you actually do want a list of lists and we'll brace the 5 and make it an array of arrayrefs.

@a = ([1,2],[3,4],[5],[6,7,8]);
print "@{$a[0]} - @{$a[1]} - @{$a[2]} - @{$a[3]} \n";

Or, sticking to your original arrayref of arrayref notation:

$a = [ [1,2],[3,4],[5],[6,7,8] ];
print "@{$a->[0]} - @{$a->[1]} - @{$a->[2]} - @{$a->[3]} \n";

cLive ;-)

Re:My short experience with perl... (1)

rsidd (6328) | more than 8 years ago | (#14488823)

print "@{$a[0]} - @{$a[1]} - @{$a[2]} - @{$a[3]} \n";
...
print "@{$a->[0]} - @{$a->[1]} - @{$a->[2]} - @{$a->[3]} \n";

I think that's what someone told me later, and that's exactly why I hate perl...

Re:My short experience with perl... (1)

cliveholloway (132299) | more than 8 years ago | (#14488840)

Apologies - maybe I shouldn't have dereferenced the lists within a string interpolation to try and keep the output similar to your python example, and shown you a simple example instead. I won't repeat my other reply here, but how complicated is $a[0][1] for the second item in the first list (from my first example)?

Re:My short experience with perl... (0, Flamebait)

l3v1 (787564) | more than 8 years ago | (#14488865)

So first you say it's crap because it can't be done. When you get examples that it can, you say it's crap because how it can be done. Now get lost.

Re:My short experience with perl... (1)

NadNad (550015) | more than 8 years ago | (#14488708)

How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]? In Python, it's trivial (that's how you'd write it), but in perl, nobody I talked to could give me an answer.

Uh dude, that's exactly how you write it in perl too. Well maybe you'd want [5] so it's really a "list of lists" and not a "list of lists and scalars", but still...

Re:My short experience with perl... (2, Informative)

cliveholloway (132299) | more than 8 years ago | (#14488717)

use Data::Dumper 'Dumper';
my $LoL = [[1,2],[3,4],5,[6,7,8]];
print Dumper $LoL;
Errr??

Re:My short experience with perl... (1)

rsidd (6328) | more than 8 years ago | (#14488737)

Yes, that's really intuitive, thanks. Especially when every perl doc I see around tells me to use curved parentheses for lists, and @ prefixes for variables that refer to them, and I have no clue what data structure you've used above.

My point was that I didn't need to wrap my head around such mindless syntax issues for python. (Or indeed for any language I've learned since: OCaml, a bit of Haskell and Lisp).

Re:My short experience with perl... (4, Informative)

cliveholloway (132299) | more than 8 years ago | (#14488779)

Oh please.

"Especially when every perl doc I see around tells me to use curved parentheses for lists, and @ prefixes for variables that refer to them..."

How hard did you look, really? If you go to Google and type in perl list of lists, the FIRST link takes you here [perl.com] .

And within 1/2 a page, you see this:

# assign to our array a list of list references
@LoL = (
[ "fred", "barney" ],
[ "george", "jane", "elroy" ],
[ "homer", "marge", "bart" ],
);

print $LoL[2][2];
bart

Damn anti-Perl trolls :-)

Re:My short experience with perl... (3, Informative)

forty7 (722797) | more than 8 years ago | (#14488863)

Yes, that's really intuitive, thanks. Especially when every perl doc I see around tells me to use curved parentheses for lists, and @ prefixes for variables that refer to them, and I have no clue what data structure you've used above.

You're right; you do need curved parens for real lists. It may be helpful to think of the @ mark as referring to multiple values, rather than to a list specifically. It's also used for list and hash slices, like this: @list[1,3,5] and @names{'tom', 'dick', 'harry'} (Both of those expressions really just evaluate to lists, but, particularly with the hash slice, that's not necessarily obvious).

The other responders, in their haste to point out how much perlier-than-thou they are, have glossed over the fact that 'my $list = [[1,2],[3,4],5,[6,7,8]];', as you've pointed out, doesn't exactly produce a list of lists. It produces a data structure that's close enough to a list of lists that they can call it that without being entirely wrong.

(Warning: Perl content. I love Perl, so it'll probably sound like I'm rambling. My apologies.)

You can't directly create a list of lists in Perl. Not possible, because they'll get flattened. But what you can do is create a list of *references* to lists. There are two ways to do this:
my @list1 = (1, 2, 3);
my @list2 = (4, 5, 6);
my @combined = (\@list1, \@list2);

Or:
my @combined = ([1, 2, 3], [4, 5, 6]);

This second syntax is called the anonymous list syntax.

The upshot is that lists are surrounded by (), as you already know, but that by replacing them with [], you get a reference to a list with no other name. The same can be done for hashes with {}, which means that all Perl data structures can be arbitrarily nested.

So, your Python example, in Perl, would create a reference to a list of references to lists. Its elements would be accessed like this:
my $list = [[1,2],[3,4],5,[6,7,8]];
print $list->[0][1] # prints 2

The -> is used for dereferencing, but Perl is clever enough to figure out that the value of '$list->[0]' is also a reference, and doesn't require you to write the -> between [0] and [1].

You could also write your example like this:
my @list = ([1,2],[3,4],5,[6,7,8]); # note the ()

print $list[0][1] # *also* prints 2!

It turns out Perl is *still* clever enough to figure out that $list[0] is a reference, and will automatically dereference it for you. No -> required.

I hope this helps clear things up a bit!

Re:My short experience with perl... (1)

putko (753330) | more than 8 years ago | (#14488765)

You might know this already, but the lisp family of languages have very, very simple syntax. You'd never have this problem with them. Operators are prefix -- not infix.

Everything is parenthesized fully.

'((1 2) (3 4) 5 (6 7 8)) would be your list of lists.

Re:My short experience with perl... (0)

Anonymous Coward | more than 8 years ago | (#14488828)

Everything is parenthesized fully.
'((1 2) (3 4) 5 (6 7 8)) would be your list of lists.

That doesn't seem "parenthesized fully" to me! Different people think in different ways. Based on your sentence "everything parenthesized fully", I would put parentheses around the five. If I wanted to MAKE SURE to obey your description "everything is parenthesized fully" I would write your list of lists as follows:
(((1) (2)) ((3) (4)) (5) ((6) (7) (8)))
Different minds work in different ways!

Perl 6 is (2, Interesting)

Ulrich Hobelmann (861309) | more than 8 years ago | (#14488670)

yet another Virtual Machine nobody needs, that's supposed to be well at executing lots of different languages, but probably won't really.

It's a new language built by rewriting an ugly, old hack, that only fans of the old version will probably ever use. Everybody who didn't like Perl already moved on.

Re:Perl 6 is (0)

Anonymous Coward | more than 8 years ago | (#14488687)

yet another Virtual Machine nobody needs, that's supposed to be well at executing lots of different languages, but probably won't really.

It's a new language built by rewriting an ugly, old hack, that only fans of the old version will probably ever use. Everybody who didn't like Perl already moved on.


Best summary yet, I'm afraid. I don't really see a place for Perl except with those who are already fans. Sysadmins at our job and others who do scripting have started using Python and Ruby because the syntax is cleaner and the code easier to maintain. Large and medium development projects keep using Java, smaller Ruby on Rails.

10 Years Overdue (4, Insightful)

dorpus (636554) | more than 8 years ago | (#14488677)

People in the mid-1990s spoke of "overnight obsolescence", that Perl 6 would replace everything in a few weeks, and that you had better learn a new programming language every month. Over 10 years later, perl 6 is still in beta mode.

Re:10 Years Overdue (5, Informative)

chromatic (9471) | more than 8 years ago | (#14488692)

Over 10 years later, perl 6 is still in beta mode.

Did you read the same article I wrote or is your post from the mysterious future? Larry announced Perl 6 in the summer of 2000.

Hiring here. (5, Funny)

Tei (520358) | more than 8 years ago | (#14488691)

Hello.

We need 5 years experience Perl 6 programmers for 3D game. Reference: P6DNF.

Re:Hiring here. (0)

Anonymous Coward | more than 8 years ago | (#14488801)

hi
i am smit from india

i write kernel module in perl 6

Alternative to perl6 (1)

barnacle (522370) | more than 8 years ago | (#14488736)

If you were ever frustrated by perl's lack of a sane threading mobel, messy syntax, or lack of clean OO extensions, or needed tighter SQL integration, or TIBCO AE or XML integration (at the expense of a lot of other functionality :-)), you might want to check out a new language called qore.

Even compared to perl6, qore has cleaner object support (IMHO), also features exception handling, embedded logic support, and more. Qore has a syntax superficially similar to perl's (except for the OO parts), but less scripty and more like C++ or Java's syntax in some ways.

It's even possible to write pure OO programs in qore (the program is a class), like:
http://qore.sourceforge.net/examples/xml-rpc-clien t.q/ [sourceforge.net]

Anyway of course if has drawbacks compared to perl as well (it is a realtively new language), but, as it was designed to write interfaces in and to be fun and efficient to program in, some perl fans may still like it, as it also addresses some of the shortcomings of perl5 at least from my point of view, and, after reading this article, I believe it has advantages over perl6 still as well in some areas (can't comment on the threading model, because I couldn't find any reference to it in the article, but qore has a clean shared-everything threading model and the whole language is thread-safe - also qore data structures are very simple and powerful and it's very easy to serialize and deserialize data to and from XML strings, SQL queries, TIBCO AE messages, etc which makes it a good tool for interface development).

Anyway, here are some links:
http://qore.sourceforge.net/ [sourceforge.net]
http://sourceforge.net/projects/qore/ [sourceforge.net]

(disclaimer: I am the author of the language :-) ) david

PDL (4, Interesting)

LordMyren (15499) | more than 8 years ago | (#14488744)

The article talks about some of the defining features for perl. Well, one of the defining features in my perl experience has been Perl Data Language [perl.org] , pdl. PDL _is_ whipitupitude. Its a wonderful wonderful matrix library. And it comes with the best perl shell I know.

I had to break down a equation into a sequence of linear equations. So I hacked up some PDL in like 2 hours to do that. Couldn't have been easier, even though I'd never used PDL or its perldl perl shell; I just started typing in the interactive shell until it worked as expected and until I knew what I was doing. Then I needed the results in interger, so I rounded everything down, built a permuter and sorted the permuted results for each individual segment. That took three hours, but only because I kept botching the matrix multiplication. Even with huge datasets, generating hundreds of thousands of linear equations, each spanning dozens of datapoints, permuting the linear equations, sorting them and selecting the optimal, PDL would run it all my slow arse 800mhz crusoe laptop in seconds. Matlab couldnt touch it.

Thats the other really truly thing about PDL; the performance. If someone else would chime in and do it better justice, but my crude understanding is that it generates some kind of extremely optimized machine code on first use and runs whatever equations you've thrown at it like silk from that point on.

Little late and a little off topic, but PDL really is just a masterpiece of perl hackability. The PDL perl shell is truly spectacular; get some symbolic integrators and differential equation solving packages in there and I wouldn't need to break open Mathematica or Matlab ever again. Ok, long way away, pdl is really just about matricies, but it is really really sweet, and its shell is good for anyone who just wants to try something out really quickly in fully interactive perl.

That being said, I really cant wait to see where the perl6 VM is going.

G'night!
Myren

Perl 6 - Now only 6 years behind Python (0)

Anonymous Coward | more than 8 years ago | (#14488749)

I switched from Perl to Python 8 years ago. Haven't looked back since. Of course, perl has some pretty good modules which Python still doesn't, but for 80% of the jobs, Python more than lives up to expectations. Of the remaining 20% tasks it's much easier to implement them yourself in Python, in 80% of the cases.

Python still has nothing close to what is available at CPAN. There are cheap imitations but nothing too great yet (in terms of quality of modules).

On the other hand, 80% of the modules you typically need are included with the standard distribution. (Batteries included)

Barney

** Flame war begins **

Perl 6 ~= LISP (2, Interesting)

paulthomas (685756) | more than 8 years ago | (#14488768)

The article mentions blocks being closures and the fact that Perl 6 -- much like the new regex system -- is itself really a programmable grammar. It sounds like we now have real macros.

The question is: is Perl becoming a LISP implementation?

Re:Perl 6 ~= LISP (1)

chromatic (9471) | more than 8 years ago | (#14488777)

The question is: is Perl becoming a LISP implementation?

No; Perl has syntax.

(Seriously, Perl 5 supports 7.5 or 8 of the 9 distinguishing features of Lisp, lacking mostly sane macros.)

Re:Perl 6 ~= LISP (1)

Animats (122034) | more than 8 years ago | (#14488817)

Perl 5 has closures, although it's not obvious. They're useful when you have a function that takes a callback, and you want to pass some data along with the callback function.

PUGS (3, Informative)

putko (753330) | more than 8 years ago | (#14488774)

Here http://www.pugscode.org/ [pugscode.org] is something on the PUGS project, which is making an implementation of Perl 6 in Haskell, conformant to the spec.

Apparently they are having a lot of fun.

Perl is between awk and C (2, Insightful)

Pausanias (681077) | more than 8 years ago | (#14488775)

I do scientific computing (astronomy). I never met the task that was too cumbersome to write in C, while at the same time too complex to write in awk.

I keep waiting for a task where it would make sense for me to learn perl... it's never come along.

Meditations on Perl 6 (4, Funny)

starX (306011) | more than 8 years ago | (#14488802)

If the release of Perl 5 was any indication, Perl 6 is the single magic bullet that will kill all of my (Perl) code.

Perl 6 may be more akin to a divine programming language, which makes the implimentation of complex data structures simple and sublime. Then again, it could all be a nasty trick to lead us away from the true path of enlightenment.

Perl 6 is not .NET.

Perl 6 is not controlled by any major corporation; I haven't decided whether this is advantageous or not yet.

If I were to have a child, would it be written in Perl 6?

Can Perl 6 be used to unlock the secret mysteries of the Bible code to reveal the end times?

Is Perl 6 really being developed by the descendants of Jesus Christ? Is the Pope trying to cover it up? Does the Pope know what Perl is? If so, is using Perl 5 a sin? How about Perl 6?

I bought a preview book on Perl 6 a few years ago. Is it still useful? Can I have my money back?

If Ruby was an upgrade to Perl, and Perl 6 is a an upgrade to Perl and Ruby, will Ruby need to changes their name in such a way as to play off of Ruby Tuesdays?

If I enter the Perl 6, can I change my mind later?

If Perl 6 is brillian, but no one uses it, is it still brilliant? What if it's awful and everyone uses it?

So very tired....

Old and tired Camel (0)

nighty5 (615965) | more than 8 years ago | (#14488806)

No wonder it needed a re-write, its outdated and crufty, compared to more modern scripting languages. Perl has lost its identity, razzle and dazzle from then it was first introduced..

With hacked on OO, CGI that is painful - there is little reason to revisit, because looking at Perl 5, and Perl 6 - they look completely different.

Thank god for new things like this [ruby-lang.org] to keep [python.org] one amused [php.net] .

My latest web development platform, is Ruby on Rails. I was a sworn Perl, PHP guru until I started using this puppy - its absolutely amazing. Everything else is just too tiring..

Oh my god, let the flame wars begin!

link kills browser (1)

tehwebguy (860335) | more than 8 years ago | (#14488836)

offtopic i know, but is anyone else able to load the article link? my firefox goes nuts and freezes when i try..

Re:link kills browser (1)

Russellkhan (570824) | more than 8 years ago | (#14488880)

Works fine for me, but I have scripts disabled as well as adblock with a pretty thorough blocklist on my Firefox. (Adblock shows subdocuments amd images from doubleclick.net, oreillynet.com and googlesyndication.com blocked, Noscript shows 8 scripts from perl.com and oreillynet.com blocked, but there probably would be more scripts if adblock hadn't prevented the subdocuments from loading)
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

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

Submission Text Formatting Tips

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

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

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

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...