If I do pugs -h, then it suggests to me the -C option will do the
trick, but does not say what value the backend might be.
But I'm also having trouble running the script. It runs OK with perl
5, but pugs complains:
*** Error:
unexpected "f"
expecting ";" or "}" at string_value.p6 line 5, column 5
The script is:
#!/usr/bin/perl
sub test {
return unless defined wantarray; # void context, do nothing
my @parms = @_;
for (@parms) { tr/a-z/A-Z/ }
return wantarray ? @parms : $parms[0];
}
print test ("ok")
so it seems to dislike the for, but I guess it's something that comes
before that. Is there a list of incompatibilites with perl 5 anywhere?
(I might add that I know very little at all about perl).
--
Colin Adams
Preston Lancashire
Well, yes and no. To run Perl 5 in Parrot, you want the ponie-dev
mailing list -- this is perl6-compiler after all. :-)
> If I do pugs -h, then it suggests to me the -C option will do the
> trick, but does not say what value the backend might be.
Thanks, the latest trunk now suggests ays:
-Cbackend compile using the compiler backend
(valid backends are: Pugs, Parrot, Haskell
> so it seems to dislike the for, but I guess it's something that comes
> before that. Is there a list of incompatibilites with perl 5 anywhere?
> (I might add that I know very little at all about perl).
The short answer is that Perl6->Parrot codegen is currently very
primitive in Pugs; I expect to improve it next month with Leo and Chip,
but currently it's not robust at all.
However, for some (minimal) success in embedding Perl 6 via Parrot, see
mod_parrot, which has a mod_pugs layer:
http://www.smashing.org/mod_parrot/
The long answer is that, in general, Perl 5 script will not run as Perl 6
without some conversion. The definitive documents about Perl 6 is the
Synopses:
There are various quick-references in the Pugs tree, assuming you know
some Perl 5:
http://svn.openfoundry.org/pugs/docs/quickref/
There is also a Perl 5 to Perl 6 "porting guide":
http://perlmonks.org/index.pl?node_id=442402
Larry is working on a translator that can compile Perl 5 program into
Perl 6, known as PPD, but it's not released yet. Nicholas Clark is heading
an effort to run Perl 5 on top of Parrot VM, known as Ponie:
Thanks,
/Autrijus/