Hi Peter,

There are several source filters that make select changes and modules
that give select Perl 6 features to Perl 5. All in all, there's a 
lot there -- I've written Perl6::Contexts, for example, which diddles
the bytecode to give Perl 5 programs most of the new contexts from
Perl 6. In fact, I kind of even wrote a book on doing this stuff...
http://www.perl6now.com. If you download the code listings, you'll get
examples of a couple dozen of these modules. As far as your example
of $array[idx], see Perl6::Variables. I have non-release version on 
Perl6::Variables in my CPAN area, SWALTERS, that adds more of the
Perl 6 changes.

I know this isn't the approach you had in mind, but I thought I'd 
mention it, as there is actually stuff there to play with. Fundamentally,
regexen to transform a Perl program aren't a bad idea, but this
approach, of fixing up Perl 5, is less likely to introduce bugs 
into the code and keeps the production-ready environment that Perl 5 is.
Transforming the code isn't a bad idea where there are transformations,
but in many cases, there aren't. I suppose that could be a fatal error,
but people would still be trying to "convert" their Perl 5 programs,
much as when people where converting to C from B, and any failure
scenario would create a flood of help requests, bug reports, etc.

I hope this helps!

Best regards,

On  0, Peter Schwenn <[EMAIL PROTECTED]> wrote:
> Dear Perl6 Language,
> I am Perl user from near year 0.  For me the easiest way to learn (,
> track, and get to the point of contributing to) Perl6 would be a Perl
> grammar (a regex rule set in, preferably, Perl6) that transforms any
> Perl5 script into a Perl6.  Of couse, besides learning Perl6 for a
> regex'r or Perl5'r such as myself, and tracking, and documenting 6, it
> would have huge use for Perl5 users making or considering the
> transition.
> For example one can infer the structure and some of the rules from
>    http://svn.openfoundry.org/pugs/docs/other/porting_howto   which is
> however written out in informal (not regex) rules such as $array[idx] ->
> @array[idx]
> Is there such a Perl5->Perl6 translator underway?
> Sincerely,
> Peter Schwenn
> www.schwenn.com
> p.s. I'm not yet up to originating a good one, but believe I could make
> contributions in extending and checking it.
> p.s. A Perl5 starting point might be better since running it on itself
> would provide and initiate at least 2 major test modes.
> p.s. The developing form of such a grammar could likely lead to
> a grammar package which facilitates rule sets for languages in
> other domains, in terms of illuminating means of choosing among modes
> for rule ordering, collecting, scoping, re-application, recursion, 
> exclusion and so forth.

Reply via email to