perl-parser? or a perl 2 java converter?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


i have prototyped some applications in perl, and now want to rewrite
them in java...

rewriting from scratch would be quite some work, thus i am looking if
there are some ready means to convert the perl code (as far as possible)
into java code...

google idn't manage to find me anything on this....

alternatively, is there a way to instruct the perl parser to issue the
parsed perl-tree before execution?

or if even this isn't possible, the reflection possibilities in perl
seem a bit limited, is there a way to ask a an instance of an object the
list of implemented methods, and possibly only the methods overwritten
in the current class?
bboett at inforezo dot u-strasbg dot fr
Unsolicited commercial email is NOT welcome at this email address

Re: perl-parser? or a perl 2 java converter?

Quoted text here. Click to load it

AFAIK there aren't any. Perl->* convertors are provided by the O and
B::* modules, but the ones such as B::C and B::CC that actually produce
working programs in other languages have pretty much all been put on
hold, and it's not recommended you use them any more as they were never
properly finished.

You could always write one, of course :)

Quoted text here. Click to load it

You could try B::Concise, but I really don't know what you think you
might do with the information.

Quoted text here. Click to load it

<standard answer for any advanced OO in perl5>
Yes, they are; this will be fixed (with a vengeance) in perl6, but don't
hold your breath.

Quoted text here. Click to load it

Not in general. You could walk the namespace and get all the defined
subs with something like

no strict 'refs';
$\ = "\n";
my $class = 'My::Class';
for my $i (keys %) {
    print $i if exists &;

but this

1. won't distingish methods from functions

2. won't distinguish public/private methods (the concept doesn't exist
in Perl)

3. won't find inherited methods (though you could check @ISA and
recursively walk those classes as well)

4. most importantly, won't find AUTOLOADed methods unless they've been
stubbed, which is usual for AUTOLOADed functions but not for methods as
you don't need to.


For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ ] *

Site Timeline