softpano / pythonizer

Translator (or more correctly transcriber) from Perl to Python
http://www.softpanorama.org/Scripting/Pythonorama/Python_for_perl_programmers/Pythonizer/index.shtml
Other
39 stars 17 forks source link

substr 4th value generates bad code #114

Open snoopyjc opened 2 years ago

snoopyjc commented 2 years ago

substr takes a 4th argument - a replacement. If you specify it, you get a #FAILTRAN error. Per the documentation;

my $s = "The black cat climbed the green tree";
my $z = substr $s, 14, 7, "jumped from";    # climbed
# $s is now "The black cat jumped from the green tree"