Author Topic: From C++ to Perl  (Read 611 times)

0 Members and 1 Guest are viewing this topic.

Offline le0nid4s

  • /dev/null
  • *
  • Posts: 14
  • Cookies: 0
    • View Profile
From C++ to Perl
« on: January 29, 2014, 04:01:05 am »
After becoming decent in c++ c and java(that is not to say that I don't have lots more to learn in those languages) I found out that I will need to learn Perl for school. So in my eagerness I looked at one of the free tutorials that perl had to offer, and jumped right in. It's different to say the least.
I know with logical programming languages such as haskell you have to think about programming differently. Is the same true with perl? Because right now I feel like I'm trying to shove a square(which in this case is my knowledge of object-oriented programming) into a cricle(procedural programming). Is there any good advice that can be offered before I continue on this long exciting journey?

Offline vezzy

  • Royal Highness
  • ****
  • Posts: 771
  • Cookies: 172
    • View Profile
Re: From C++ to Perl
« Reply #1 on: January 29, 2014, 04:26:03 am »
Haskell isn't a logic language. It's a functional language.

As for Perl, it is a different language. Not because it's procedural, but because of its background. It's deeply rooted in Unix culture and is largely inspired by AWK. Which is why it relies on so many sigils, has first-class regexes and seems cryptic to the outsider. It was also invented by a linguist, so that makes it even more unconventional.

At it's heart, Perl is a hacker's language. It doesn't restrict you much and is rather free and forgiving compared to a lot of other languages. It's much more liberal than Python, for instance. It's easy to write code that is difficult to read, but on the flip side it's easy to write any code for any purpose, because it really lets you adapt to your own style.

Perl also has a very mature community and has possibly one of the largest and most renowned repositories of libraries and modules - the CPAN. It's not really a trendy language anymore, but certainly worth learning.

My advice is to pick up some books, though. Perl has changed from the 90s and it's very easy to find outdated tutorials. The Perl documentation is good, but scattered.

My recommendations are to start with either Learning Perl or Modern Perl (which will teach you clean and contemporary Perl idioms, can be found here: http://modernperlbooks.com/books/modern_perl/), then read Programming Perl (also known as "the camel book", it's the de facto standard book, but best read after already having some knowledge).

Finally, if you intend on being a Perl monk, then go read Higher Order Perl, which teaches advanced language constructs and functional programming techniques.
« Last Edit: January 29, 2014, 04:26:37 am by vezzy »
Quote from: Dippy hippy
Just brushing though. I will be semi active mainly came to find a HQ botnet, like THOR or just any p2p botnet

Offline le0nid4s

  • /dev/null
  • *
  • Posts: 14
  • Cookies: 0
    • View Profile
Re: From C++ to Perl
« Reply #2 on: January 29, 2014, 06:25:43 pm »
Thanks for the help! Those books look great.