Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change


by Anonymous Monk
on Aug 11, 2002 at 01:58 UTC ( #189254=monkdiscuss: print w/replies, xml ) Need Help??

I realize that you can find these at the end of certain tutorials and various other places, but I would like to see a section dedicated to various exercises one could do to improve his/her skills (maybe even chatergorized by skill level). The easiest way to learn a language is to actually use it, but it is often hard to get good ideas for non-trivial exercises.

Replies are listed 'Best First'.
(jeffa) Re: Exercises
by jeffa (Bishop) on Aug 11, 2002 at 22:43 UTC
    Well, one way to exercise Perl skills is by hanging out at the Monastery and answering questions - and just because a question has already been answered doesn't mean that you can't exercise. Just don't look at the answers and remember that you don't have to post your answer. Answering questions is more than just XP, it is a way to see how others make mistakes, which helps you understand Perl better by exercising 'muscles' that you didn't know existed.


    (the triplet paradiddle with high-hat)
      If you look at it that way, you can treat the entire 3 billion node archive of 'SOPW' as your own personal question catalog!!! Doesnt that make you feel warm and fuzzy inside?!!?
Re: Exercises
by virtualsue (Vicar) on Aug 11, 2002 at 11:52 UTC
    Perhaps someone will be kind enough to make up some higher-level exercises and post them. Maybe you yourself could take a shot at it. Then the site documentation clan (or other PM authority figure) would be able to add "Perl Exercises" as a category in Tutorials.
      Sorry I wasn't clear, I'm *very* new to Perl, which is why I asked about it. I just know from experience that when it comes to learning a language good exercises are hard to come by.
        i like this idea, i think it would be a good way for people learning perl to get a chance to create some useful, practical programs, and be able to compare how they did it to how more experienced programmers did it.
Re: Exercises
by demerphq (Chancellor) on Aug 15, 2002 at 17:10 UTC
    Heres a couple of excerices you might try,
    • Implement a binary tree using arrays as nodes , then reimplement using hashes. Operations defined should be depth first traversal (inorder, preorder and postorder) along with breadth first traversal, insertion, deletion, and merge operations.
    • Convert the previous implementation into a fully object oriented one.
    • Change the binary tree to a 2-3 tree.
    • Implement a version of Data::Dumper. Try to add a feature that Data::Dumper doesnt have, but dont try to replicate all of the functions it does.
    • Implement a huffman encoder. Try not to use any of the methods used on site. :-) Then check against the site.
    • Write a game, pick any simple game like hangman or the like
    • Take any program you have written in another language, and rewrite it so it runs under perl.
    • Take an existing program and try to rewrite it without using block style loops. map{} grep{} and modifiers are ok.
    Some or all of these are what I found particularly instructive as i learned perl.

    Yves / DeMerphq
    Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)

Re: Exercises
by tbone1 (Monsignor) on Aug 15, 2002 at 13:12 UTC
    While I like this idea, I wonder if it would take away royalties from the sales of certain monks. (Remember, support your local artist.)

    As God is my witness, I thought turkeys could fly.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-10-19 10:07 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (76 votes). Check out past polls.