# perl -E 'foreach (my $i=0; $i<3; $i++) { say $i }'
0
1
2
# perl -E 'for my $i (0..2) { say $i }'
0
1
2
I never use foreach in Perl 5, and that's what I'm paid to write in. This is just a reaffirming that "for" is the preferred syntax (and this isn't a TMTOWTDI thing, this is two reserved words for the exact same code construct thing).Moose, interestingly enough, is based on backporting the then-proposed Perl 6 object system, so a lot of the concept sand terminology will be the same.
But it sounds like you are talking about transitioning from Perl 5 to Perl 6. Why? The naming is confusing, but most people are not expected to convert codebases to Perl 6. It's not an upgrade, it an also. If you want both, use Inline::Perl5[1] and just call back and forth between the interpreters.
Do you have/write test suites? In P5? P6?
Have you seriously tried any of the p5-to-p6 translators with your scripts?
Was the usage message typically much-improved, about-the-same, or needs-work after your first successful compile?
Same question for command line argument binding?
Any speed stories? Scripts that started unacceptably slow but eventually got there? Ones that beat their Perl 5 originals? Ones that didn't really make it yet?
Have you converted any of your Perl 6 conversions back in to Perl 5 code (to retain the clarity developed in the conversion to 6 but regain the speed that Perl 5 has)?
Do any of your conversions use Perl 5 modules?
...with an exceedingly poorly chosen name.
(Which is not to diminish how good it is as a language.)
I personally wouldn't mind if there was a slow shift towards using the current main implementation's name (Rakudo) or some other (NG Perl?) for the language down the line, but I think doing so before release would just make every problem worse, including Perl 5's ("Oh, Perl 6 is no more? It failed? I knew it would... Perl is a dead end.")
You mean it will take time before you trust the "use Perl 5 code in Perl 6" bridge that is worked on, so it isn't enough to run the Perl 5 tests and then use that code in Perl 6?
(Or you think there will be bad interactions with Moose and Perl 6 OO?)
Edit: Huh, I was shortly un-hellbanned and am Hellbanned again since the previous comment didn't live up to some interesting-level standard? :-)
Maybe your comment got rescued by someone using the new vouch feature?
Even with Inline::Perl5 you need to test the implicit 5<->6 casts with the perl6 vm (which might be rakudo or some other engine).
Moose contains only a small subset of the Perl6 OO, and has also different syntax. E.g. in perl6 types lead to optimizations, in Moose to pessimizations. Rewriting in Perl6 is always preferred, as Perl6 is a much nicer language.
Sorta like the old F2C, Fortran to C, converter. You don't get idiomatic C, but you do get a fortran program that compiles and runs as a C program, more or less.
Some parts of perl6 are annoyingly urbit-y, come on, you guys just had to rename ARGV and rename scalar and the for-foreach transition is ridiculous. I suspect at least a decade of people pointing at items and verbally calling them scalars and so on. Urbit is cool but is most famous for feeling the need to rename everything.
Here's a slide stack for going from MOOSE (more or less the most popular "real" perl5 OO implementation, technically an "add on" for perl5 although many people will only program perl5 with MOOSE) to perl6 OO. At least toward the middle there are adjacent slides of "this is how you do it in MOOSE" "this is how you do it in perl6"
http://www.slideshare.net/lichtkind/p6-oo-vs-moose-moo
I'd like to read a book titled something like "Modern Perl; For Perl 6.0"
The transition will be such fun; I have some business logic libraries where I'll have to replicate behavior and test suites simultaneously for awhile in MOOSE/5.0 and in 6.0.
(response to unfortunately hellbanned berntb question about replication, the codebase is huge and interrelated and can't be forklift upgraded all at once; its already non-trivial to do stuff in both perl and scala, and now it would be perl5 perl6 and scala all more or less interoperating)