snoopyjc / pythonizer

Automatic translator from Perl to Python
https://snoopyjc.org/pythonizer/
Artistic License 2.0
12 stars 1 forks source link

Symbolic reference not generating proper code #361

Closed snoopyjc closed 1 year ago

snoopyjc commented 1 year ago

Symbolic reference not generating proper code. For example (from Date::Manip):

my $backend;
$backend = 'Date::Manip::DM6';
my $backend_exp = $backend . "::EXPORT";
{
    no strict 'refs';
    @EXPORT = @{ $backend_exp };
}

The generated code assumes $backend_exp is an arrayref.

snoopyjc commented 1 year ago

We can fix this case where we know the type of the expression is a string (S type in pythonizer).

snoopyjc commented 1 year ago

Fixed in v1.030