Appendix B. PERL TO PYTHON QUICK REFERENCE

You can use this guide as a quick reference for converting your existing Perl scripts to Python. Below you will find a list of the major Perl components, their Python equivalent if one exists, or an alternative solution if it's supported. You'll also find the necessary pointers to take you to a chapter with more detailed information.

Perl Python equivalent Reference
$!, $ERRNO, $OS_ERROR Errors and messages are handled through the exception system. If you need to translate error numbers to strings use the os.strerror() function. To compare error numbers use the errno module 96
$", $LIST_SEPARATOR Use string.join() to manually bond lists together 189
$#, $OFMT Use the format % tuple operator to format ...

Get Perl To Python Migration now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.