#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    330
    Rep Power
    15

    Converting to Perl or vice versa.


    Hello,

    I am an intermediate Python user, I have come to situations where the use of Perl is necessary and the only option. I was wondering if there are any programs written that would convert Python scripts to Perl and vice versa. If not, is anything like this even possible?
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    There are programs that could do this, I remember seeing some in google but I do not remember the sites. If no one else responds with a site for a program like that, you could just search google.com and see what you find.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Colorado, USA
    Posts
    68
    Rep Power
    11
    yegg is correct--google is your friend

    see:
    Python to Perl Language Translation
    http://perthon.sourceforge.net/

    Seems to be one of the few actual packages out there, but is in alpha, and may not work correctly.

    There seem to be a few people out there, who are willing to charge you for the process, but on the OSS front, there doesn't seem to be a whole lot.

    Anyone else seen a package out there?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    34
    Code:
    import string, random
    
    data = list(string.punctuation)
    
    for line in file("code.py"):
        random.shuffle(data)
        perl.write(''.join(data))
  8. #5
  9. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    summarised in 5 lines. That says it all

IMN logo majestic logo threadwatch logo seochat tools logo