Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl tutorial building on Python skills?

by soonix (Canon)
on Oct 20, 2021 at 10:40 UTC ( #11137792=note: print w/replies, xml ) Need Help??


in reply to Perl tutorial building on Python skills?

I don't have materials of my own, but some points: especially with a Python background, some of the differences stand out:
  • context is a concept unique to Perl, and explained very good in the corresponding chapter of chromatic's book
  • Python has an explicit Boolean data type, Perl has a boolean context
  • Python regular expressions are strings, hence different quoting, and "PCRE" are not 100% "PC".
  • last but not least: as Python only has lexical scope, it was difficult for me to understand dynamic scopes, and although there is overlap between Perl's local and computer science's local, they are not the same.
  • Comment on Re: Perl tutorial building on Python skills?

Replies are listed 'Best First'.
Re^2: Perl tutorial building on Python skills?
by LanX (Sage) on Oct 20, 2021 at 11:08 UTC
    Thanks for the valuable input of all of you , didn't have the time to reply in detail yet.

    I have to wait to meet the new colleague to assess which kind of programming/python skills be already has.

    After all Python is the new Basic, everyone claims he knows it. I don't wanna end up explaining Python to him or giving a class in language design...;)

    > "PCRE" are not 100% "PC".

    Minor nitpick. PCRE is also the name of an RE engine used by several products including PHP. Python has its own RE engine, trying to be PC

    > Differences

    More:

    • function signatures
    • Most (all?) variables are references
    • strings are immutable
    • regex are first class objects in Perl
    • list flattening/interpolation in Perl

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-05-26 21:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (94 votes). Check out past polls.

    Notices?