Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Programming Perl

by Athanasius (Chancellor)
on Oct 11, 2012 at 07:28 UTC ( #998381=note: print w/replies, xml ) Need Help??

in reply to Programming Perl

Hello imlepid,

It seems to me that “mastering” Perl has 5 stages:

  1. The basics: simple syntax, context, sigils. I’m sure you have this down already.
  2. Perl idioms, including the standard uses of foreach, map, grep, etc.
  3. References and complex data structures.
  4. Regular expressions.
  5. Domain-specific experience with CPAN modules for using databases, etc., etc.

For me, 3 was something of a steep learning curve (but one I eventually got over). But 4 is an ongoing journey of discovery! (For example, see my very recent post Re^2: RegEx + vs. {1,}.)

Now, I would definitely recommend that you acquire the latest edition of the Camel Book, but “reading through” is probably not the way to go. Focused reading, targeting any weak areas in the above list, will likely be far more productive.

And don’t neglect other sources of information: Perl documentation, especially the FAQs, comp.lang.perl.misc, and of course PerlMonks! Also don’t be afraid to challenge yourself. I can’t recommend Higher-Order Perl (free online) by Dominus highly enough in this regard.

Just my 2¢,

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Programming Perl
by Your Mother (Chancellor) on Oct 11, 2012 at 15:29 UTC

    I like your list but argue there is no idiomatic usage of foreach as idiomatic usage will prefer it be spelt for.

Re^2: Programming Perl
by aaron_baugher (Curate) on Oct 12, 2012 at 02:12 UTC

    Your list is interesting, because in my own case, your #2 (idioms, map, grep) came at #5, after everything else. I suppose that's because previous experience with C pointers made references easy, and experience with grep and awk did the same for regular expressions (though I agree that there's always more to learn about those). Also, you just can't do a lot of useful work without regexes, complex data structures, and CPAN.

    You can get away without map/grep and other Perlish methods like statement modifiers, though, by using a lot of loops and making your code look like C or some other language. So I tend to think of the idiomatic stuff as the sign that someone's not just capable of programming in Perl, but comfortable with it.

    I suppose everyone's list might be a little different, based on their own previous experience.

    Aaron B.
    Available for small or large Perl jobs; see my home node.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998381]
[Corion]: Cosmic37: Ah, see perlfaq4, about How do I compute the intersection of two arrays
[Cosmic37]: I am out of practice; I use Perl for scientific programming for number crunching
[Corion]: Cosmic37: Basically, you read one file into a hash, keyed by your key, and then match the lines from the second file to that hash
[Cosmic37]: note that the two files only have datetimes which may match whereas other data per line is different format in file1 and file2 - is that really intersection?
[jedikaiti]: Hi Monks
[Corion]: Cosmic37: Well, if you want to use only parts of a line for the key, see split or whatever other mechanism to extract the key from the line
[Corion]: Hi jedikaiti!
[Cosmic37]: is there a webpage for full CB for this chat rather than side panel chat?
[Cosmic37]: thank you for advice
[Cosmic37]: peach greets jedi

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-06-29 16:21 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (672 votes). Check out past polls.