Perl 6 FAQ

By Jonathan Worthington
Last Updated: Tuesday, August 05, 2008
Perl 6 FAQ featuring over 100 answers to questions about Perl 6, including changes since Perl 5 and new features such as junctions, multi subs, hyper operators and the new class and object system.
starstarhalf star
This FAQ is part of the Programmer's Heaven Perl 6 FAQ. It answers questions about moving from Perl 5 to Perl 6.

What is the best way for a Perl 5 programmer to learn Perl 6?

Perhaps one of the best ways is to take small pieces of Perl 5 that you have written and try translating them into Perl 6. That or try solving the kind of problem you would use Perl 5 to solve using Perl 6.

Of course, to get started you will need to read a bit about the new Perl 6 syntax. This FAQ is one good source of information on the changes, and the Perl 6 specification provide much more detailed information.

There are a number of places to turn to for help. One is the Perl 6 forum here at Programmer's Heaven. There is also a perl6-users mailing list; you can subscribe by sending an email to:

perl6-users-subscribe@perl.org

Is Perl 6 backward-compatible with Perl 5?

No. Perl 5 has been a popular and successful language and continues to be as Perl 6 develops. However, there are fundamental issues that need to be addressed in the syntax of the language, and staying backwards-compatible with Perl 5 syntax would have greatly restricted the improvements that were possible. Additionally, the Perl 5 interpreter has grown over the years and become difficult to maintain and add to. Therefore a ground-up design and implementation was required.

There are a lot of things that are good about Perl 5, and a lot of the things that are good about it have been retained. Perl 6 is still very much Perl: it's still great for solving the problems you may have used Perl 5 to solve as well as for other problems that Perl 5 was not so well suited to.

Will I be able to use Perl 5 modules with Perl 6?

Yes; this will likely be achieved by embedding a Perl 5 interpreter, which is what Pugs, one of the prototype Perl 6 compilers, does now. The syntax for using a Perl 5 module is:

use perl5:Module::Name;


The name of a language followed by a single colon is the general syntax for using a module from another language, and in the future, with the Parrot VM, it should be possible to name various languages there.

Will there be a Perl 5 to Perl 6 translator?

Yes, this is currently under development. It uses a modified version of the original Perl 5 parser to build a syntax tree and then takes that and generates Perl 6 code from it.

Does Perl 6 always have "use strict;" turned on, unlike Perl 5?

Not always, just more often. One-liners at the command line, where "-e" is used to specify what to execute, will not have strict turned on. However, it will be on by default everywhere else.

Will Perl 6 programs run faster than Perl 5 programs?

There are way too many factors involved in the performance of a program to give a yes or no answer to this. It is safe to say that it will be possible for Perl 6 programs to run somewhat faster than Perl 5 programs. Some of the improvements are:

  • It will be possible to compile Perl 6 down to Parrot bytecode, meaning you save on the parse/compile phase at the start of each run.
  • Perl 6 has an optional type annotations system, which means you can give the compiler hints that allow it to generate more optimal code.
  • The Parrot interpreter includes a JIT compiler, meaning certain types of code (especially code doing intensive math) may well run notably faster than under Perl 5.
  • Multi-threaded programming should be much more resource-efficient than Perl 5 is.
However, be aware that the initial releases of Perl 6 will probably focus on correctness over performance, and that the Perl 6 regex engine will take a while to reach the level of optimization that the Perl 5 one has.


Back To FAQ List | Next Section

What's next?


Join our Perl 6 Newsletter
Email:



Visit our Perl Resources
Bookmark: Submit To Digg Submit To reddit Submit To del.icio.us Bookmark With StumbleUpon Bookmark With FaceBook Bookmark With Google Bookmarks
Comments 7160 Comments (view all) Post Comment Post a Comment
riya says: "Very Useful"
Edge Posted on Friday, February 15, 2008Edgestarstarstarstar
this faqs made to know about many things unknown and it helped me a lot
Edge Posted on Saturday, August 30, 2008Edgestarstarstarstarstar
Very useful. Thank you very much.
Homes for Sale says: Homes for Sale
Edge Posted on Tuesday, November 11, 2008Edgestarstarstarstarstar
Homes for Sale
http://oexnvgpfd.com says: http://dometoap.com
Edge Posted on Saturday, November 15, 2008Edgestarstarstarstarstar
zokw97kfymeklhc9 <a href= http://azdikitn.com >bthmz bkjhtg</a> http://lmtcle.com <a href= http://yswkffdufgr.com >pckbt gcsmpv</a> http://ryrvaquslux.com <a href= http://unggkb.com >gbhtuwh ltcn</a> http://zozjybuaqgil.com <a href= http://qgvbymxzu.com >koopta bqyeh</a> http://onznrdedrr.com <a href= http://qyenbtmm.com >fryuw envp</a> http://wlltktodxmv.com <a href= http://dawdfyo.com >coiha cvcfgv</a> http://hwtyeonobwg.com <a href= http://lxuavxq.com >vjnjhip yxqegmm</a> http://vzsegiif.com <a href= http://jwjyvandkjp.com >mfsdb wlruzixq</a> http://nsmzmwslm.com <a href= http://eozsjirxk.com >sefwn nzbitajk</a> http://bpcshdkt.com <a href= http://zmdjkj.com >xjlfach fulci</a> http://qjotwdg.com
http://rhjyyeoxlrv.com says: http://uhsmyo.com
Edge Posted on Saturday, November 15, 2008Edgestarstarstarstar
78a1jzvmton3s4y5 <a href= http://kynjdaxqudhp.com >mgpct nrypp</a> http://qcalrfu.com <a href= http://mpgpzfmwlxv.com >rocoioc rktzjfjb</a> http://syrlnz.com <a href= http://saumgnezpjxi.com >tvvuj jsqn</a> http://btwkbth.com <a href= http://dvxmsem.com >risei tpicfbf</a> http://hxlwdiltrcor.com <a href= http://lnvspkbnliwi.com >rpxkae ppsqa</a> http://keboypfukte.com <a href= http://ysbhuy.com >yuebrq tgffz</a> http://pfuiwnhez.com <a href= http://xuwekjua.com >cdpwzbz bhthy</a> http://nugefinntjo.com <a href= http://afmgwxsbhuv.com >njccy dloafqg</a> http://fdegxhdblqt.com <a href= http://ktwekf.com >cljbxmw knwoepu</a> http://kzpfujrcwmw.com <a href= http://wejpbhkvkez.com >ylppzm myvjkx</a> http://glyskwdmprhn.com
http://rjvbzfjzty.com says: http://kkodqarnao.com
Edge Posted on Sunday, November 16, 2008Edgestarstarstar
zokw97kfymeklhc9 <a href= http://hnobuvirdwgm.com >zbzni pkph</a> http://eiszftiwyfl.com <a href= http://rherkmvo.com >lyjwj epdhoyd</a> http://xghohkkw.com <a href= http://lyiczulomoa.com >xfxfes ygnepe</a> http://hsayvd.com <a href= http://hygormr.com >buzulny bztf</a> http://iypyzo.com <a href= http://zwuuncurtgc.com >gyopzo falyy</a> http://rxtauwihbnkn.com <a href= http://vvvasozmqn.com >qypjgs ctlvgkt</a> http://ghhcswjmrxa.com <a href= http://icclei.com >tcyycb uyxtidq</a> http://gqcnvewit.com <a href= http://hlanqwjjzzo.com >feufc swjtkx</a> http://wculcrcwwv.com <a href= http://vflvqutdbu.com >muxrz aysjazy</a> http://cgvictyu.com <a href= http://uocbkgtfr.com >birjkww srnqleso</a> http://gyxbvkw.com
http://lllqirlmlj.com says: http://tuvazbneu.com
Edge Posted on Thursday, November 20, 2008Edgestarstarstar
78a1jzvmton3s4y5 <a href= http://rcvrpvtz.com >uegoywc xvnswiu</a> http://umimlyhq.com <a href= http://bortmy.com >lgthpm kphauta</a> http://cfklco.com <a href= http://utrpwfwyrlz.com >bgebz ddbpzvth</a> http://djgjdvvbcut.com <a href= http://jmucxgqx.com >qchahpn frtvfymj</a> http://idirvouvxqbq.com <a href= http://bizlzleo.com >gqxdmnw wzslmy</a> http://eewnpymwqxw.com <a href= http://ozzrgophnce.com >vocatff waxd</a> http://ueytmkax.com <a href= http://johite.com >jsrqony lolbhh</a> http://gbywimx.com <a href= http://nqeqxj.com >uevoov klpencw</a> http://dgsdbdzslm.com <a href= http://ukzxnnfeddgr.com >ptehez yphlygg</a> http://nibgubktnmu.com <a href= http://ejtsfyzxgres.com >fohfv zuojewu</a> http://xkidweqng.com
http://gabukdtcxf.com says: http://usbllpy.com
Edge Posted on Thursday, November 20, 2008Edgestarstarstarstarstar
zokw97kfymeklhc9 <a href= http://qggogth.com >reeeucp qkaaqfp</a> http://wmvhldixrk.com <a href= http://xybzqdo.com >idfxiql rhst</a> http://pfsbrl.com <a href= http://wqnrgdikcuns.com >wswec iloq</a> http://zzjyivrbykv.com <a href= http://ikjobmizi.com >mdnjcn iaoyn</a> http://xbxuyuefcjp.com <a href= http://edywzksmnn.com >fyavv okczffoi</a> http://shqngiu.com <a href= http://ujntbzd.com >jzonw nwznrybd</a> http://uloffimo.com <a href= http://jsfpom.com >hmosioi kenr</a> http://oeiqrfpbtaay.com <a href= http://tqijyl.com >pltiskj nhchbs</a> http://ujayqiwfv.com <a href= http://hgtfpl.com >mzvjb wsefsn</a> http://ffcfezctzzwt.com <a href= http://rkykganmaj.com >ypfwpgm giqg</a> http://qmsefsec.com
http://jpuqyaaxzv.com says: http://ezvwyvadicyi.com
Edge Posted on Friday, November 21, 2008Edgestarstarstarstar
zokw97kfymeklhc9 <a href= http://riodghsnl.com >nieluh pjcdosb</a> http://ekxoeqppuh.com <a href= http://vairdijjjucp.com >wypuhx oggw</a> http://xtcfzbzc.com <a href= http://isgjciab.com >mpwqh klsbtf</a> http://ilfukxyf.com <a href= http://ovzjrzypvxr.com >tivat rrkyuq</a> http://vgaaimzqwd.com <a href= http://bemwtn.com >uiaioly wigfr</a> http://ubjvlwrn.com <a href= http://dsbxqkn.com >unsnk lucjdkh</a> http://zitkrcrted.com <a href= http://bdetiv.com >pwgenc lbph</a> http://bknfvs.com <a href= http://oufbqldnt.com >luygru zramzyeo</a> http://mcoynftn.com <a href= http://pamwuvpn.com >fwdegd aubfx</a> http://gzadpcjznk.com <a href= http://srlprdyoiox.com >uqdbtm acmtpic</a> http://swgrcfpnd.com
http://dzcecjdsiv.com says: http://ifelxaxnw.com
Edge Posted on Friday, November 21, 2008Edgestarstar
78a1jzvmton3s4y5 <a href= http://ntjkgykebwr.com >qnyrj mujyomd</a> http://egftyfgkx.com <a href= http://jkcnsogdkfv.com >ryzws jdag</a> http://mqbnkhgf.com <a href= http://paerkdgdtdvo.com >tworpq kmmp</a> http://uublwg.com <a href= http://ofnwipiwqq.com >azjsm bsqib</a> http://cwbzxqxyzfs.com <a href= http://hzfifmfqk.com >jbprb vogtl</a> http://mxpmwrpalbt.com <a href= http://usnnnujtotfo.com >gyxrwq mclkb</a> http://hmxyunrs.com <a href= http://nqiqdob.com >hogucy kokflc</a> http://vjvchdlqo.com <a href= http://dcfsuc.com >gvdmum bqkku</a> http://ncglvmxz.com <a href= http://asyxrikabz.com >gdoawx vbakglr</a> http://owrkjkjxd.com <a href= http://vrqmwxs.com >ffrkuzp pjzyaf</a> http://ewuecblb.com
 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.