Perlito5 doesn't support 'use' in the browser out-of-the-box, because
it depends on some filesystem commands:
src5/lib/Perlito5/Grammar/Use.pm:156
if (-f $realfilename) { ... }
src5/lib/Perlito5/Grammar/Use.pm:190
my $source = Perlito5::IO::slurp( $realfilename );
You can workaround by implementing these 2 subroutines in javascript
(maybe using AJAX), or by precompiling your perl source code in the
command line (server side).
If you'd like to try the client-side option, the place to look is
src5/lib/Perlito5/Javascript2/IO.pm.
Flavio
2013/7/31 Elizabeth Mattijsen <[email protected]>:
> On Jul 29, 2013, at 1:34 PM, Pierre M <[email protected]> wrote:
>> Perlito can translate my Perl5 code to Javascript.
>>
>> Does it mean that i can use Template::Toolkit and all the other CPAN modules
>> that i want, on client-side?
>
> I'm not sure whether Flavio is following this mailing list.
>
> But to answer your question to the best of my knowledge:
>
> maybe, at some point in time, when these prerequisites have been met:
>
> 1. Perlito supports "use": afaik, it doesn't support generic "use" just yet.
> 2. the modules that you (indirectly) use, are all Perl only, without XS
> components (not likely)
>
> There is another project that converts C-code to Javascript, that has been
> compiling Perl itself to Javascript, run by one of the London.pm guys. You
> may want to check on the London.pm mailing list.
>
>
>
> Liz