pythonizer icon indicating copy to clipboard operation
pythonizer copied to clipboard

Translator (or more correctly transcriber) from Perl to Python

Results 100 pythonizer issues
Sort by recently updated
recently updated
newest added

Pythonizer will not run under Strawberry perl on windows. It uses `date`, which on windows reads a new date from stdin, then tries to create /tmp/Pythonizer/pythonizer which also fails.

substr of 1 char length at end of string generates code that gives IndexError. In perl a substr at the end of the string should give the empty string as...

Last element index ( $# ) of a hash causes internal error. For example: $#{$package->{type}} gives several "Use of unitialized value $1 in..." messages.

The m flag on regex gets treated as the start of a new regex. For example; my @lines = split(/^/m, $expr); gets parsed as a /^/ regex, followed by a...

tr ranges need to be expanded for maketrans. The python maketrans call doesn't accept ranges, so wrong code is generated for like: tr/a-z/A-Z/;

tr with d flag generates bad code if there is a replacement string. It only generates correct code if the replacement string is empty. For example: tr/ac/b/d; should map a->b...

tr arguments should not be interpolated

Regex with DEFAULT_VAR and capturing groups needs to always set the DEFAULT_MATCH. There are cases in the code where it's not set, but if the user then refers to $1...

Enhancement: Implement the c flag on tr

Hash initialization generates bad code if there are any expressions on the RHS