in reply to Re: Perl tutorial building on Python skills?
in thread Perl tutorial building on Python skills?
> 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 (autovivification), which shows how I emulated it in Ruby.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl tutorial building on Python skills?
by BillKSmith (Monsignor) on Oct 20, 2021 at 13:57 UTC | |
Re^3: Perl tutorial building on Python skills?
by LanX (Saint) on Oct 22, 2021 at 15:12 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 22, 2021 at 20:10 UTC | |
by LanX (Saint) on Oct 22, 2021 at 21:24 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 23, 2021 at 00:23 UTC | |
by LanX (Saint) on Oct 23, 2021 at 01:03 UTC |