2. Python dictionaries take tuples (and not strings) as keys - this makes Perl hashes hard to use for that area, as you have to find a way to encode any tuple to a string and back (I think of URLencoding the tuples and a special marker for the different elements of the tuple)

Well, no. :)

The values of dictionary keys in Python can be any immutable object, including strings and tuples that contain no mutable elements (e.g. a tuple that contains a list as one of its elements could not be a key).

As yet another challenge to add to the list; sigils. $foo, @foo and %foo semantics can't be represented in Python.

Python has built-in support for iterators and generators; Perl does not. There's no reasonable conversion path for these semantics.

Python classes can inherit from built-in types. The complications of munging this into some funky tie-fu aren't worth the return on investment (especially when you consider that Python's built-ins are a lot different from Perl's built-ins).

The best way to convert Python to Perl and Perl to Python is to contribute to the development of Parrot because there are far too many issues to make it reasonable to truly "convert" one to the other.

It's like trying to "convert" a BMW M5 into a Ferrari 360 Modena. I'll let you decide which is which. :)


In reply to Re: Re: Converting Python to Perl and back again by bradb
in thread Converting Python to Perl and back again by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.