Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Perl tutorial building on Python skills?

by Discipulus (Abbot)
on Oct 20, 2021 at 07:41 UTC ( #11137775=note: print w/replies, xml ) Need Help??

in reply to Perl tutorial building on Python skills?

Hello LanX,

A conversion! Finally :) It will be similar to the Neo escape and awake in Matrix :)

A quick search shows a python to perl translator.. well is a 2003 project, probably no more useful, but the example in the page can be a start.

Another one seems very poor quality at first glance (uppercase perl ;).

By other hand perl-vs-python comparison sheet shows something interesting, notably the sentence Perl provides freedom..

For the little I know about the snake, I'd pay attention to explain two important differences: python-data-types are different from perl ones and if they are used to work with sets and tuples they should learn how to play with data types in perl.

The second key difference is scope.

A read of perl philosopy is surely worth, but if they are already programmers then ModernPerl is the right book.


There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Perl tutorial building on Python skills?
by eyepopslikeamosquito (Bishop) on Oct 20, 2021 at 09:09 UTC

    > A read of perl philosophy is surely worth, but if they are already programmers then ModernPerl is the right book.

    Oh yes, strongly agree. Especially given the pupil is already an experienced programmer. chromatic explains why Modern Perl is so short (see also the excellent reply by xdg):

    Modern Perl assumes you're already decent at programming, so it elides some basic stuff in favor of explaining how Perl works from philosophy to programming in the large. Learning Perl assumes you've never programmed before, so it spends more time on the basics, covers less of the language, and doesn't explore the philosophy of Perl in as much detail.

    Modern Perl also tends to be kept more up to date with the latest version of Perl than Programming Perl, say.

    Depending on your pupil, it might also be worth emphasizing the difference between Readability and Maintainability.

    Not sure if you're planning on mentioning TMTOWTDI or TIMTOWTDIBSCINABTE but I noticed when playing code golf that Python often out-TMTOWTDI'ed Perl! :)

    Update: Regular expressions are built into the language in Perl, while in Python they're provided by the re module -- this makes a massive difference in terms of convenience and ease of use, so you'll probably find yourself reaching for a regex solution more often in Perl than Python (especially if you're tybalt89 ;-).

    Another key point that should be carefully explained in your course is Perl's unusual use of context, especially scalar vs list context.

    Further update: Autovivification is yet another Perl quirk -- see "Emulation in other programming languages section" for one way to emulate it in Python. See also: Re^2: Honest question about Perl, Python and Ruby, which shows how I emulated it in Ruby.

      I had planed on making much the same argument for "Perl Best Practices". I have now decided that for this purpose, it is little more than an expansion of 'Modern Perl's chapter on "Perl Beyond Syntax". I continue to recommend the Preface of "Perl Best Practices" for its discussion of the goals of "best practice".

      > chromatic explains why Modern Perl is so short (see also the excellent reply by xdg):

      Actually the second chapter in Object Oriented Perl (which xdg is dissing) includes a very good overview of (non-OO) Perl in 60+ pages.

      Damian is a brilliant author and it's a good base for an experienced programmer. (Plus I have the German translation which makes communication easier)

      Modern Perl then is larger and goes more into details and is already available in their office in Berlin.

      This should give a very good foundation to build on.

      Then later combined with my own self assessment quiz plus links into the docs, should clarify remaining issues.

      (I don't want to start learning Python in deep for this :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      ) RFC: Self Assessment Perl

        > Damian is a brilliant author

        Agreed. Always a joy to read! (ditto for chromatic and brian_d_foy).

        Unlike chromatic though, I often struggle to find free stuff from The Damian that I can link to here (I often find myself linking to Ten Essential Development Practices). If you know of other useful online stuff written by Damian, please let us know.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137775]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2022-05-24 09:23 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (82 votes). Check out past polls.