Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Real Life Perl Exercises

by mikasue (Friar)
on May 27, 2006 at 20:42 UTC ( #552038=perlquestion: print w/ replies, xml ) Need Help??
mikasue has asked for the wisdom of the Perl Monks concerning the following question:

I am learning Perl. Anywhere I can get some real life Perl exercises to try to code? I have done the exercises in Learning Perl. I have done the exercises in other books of different program languages. I have converted some of my other programs written in other languages to Perl.

I don't feel I know enough yet about Perl.

Comment on Real Life Perl Exercises
Re: Real Life Perl Exercises
by rhesa (Vicar) on May 27, 2006 at 21:04 UTC
    In my opinion, the best way to increase your programming skills is by solving your own problems. Think of something you do often, and that you think could be automated. Scratch your own itches.

    The exercices in the books have already given you a good overview of common algorithms, Perl features and other programming languages' strengths. Trying to solve a problem that bothers _you_ is the best way to become intimately acquainted with the features you need. It'll also teach you how to look for the things you need to solve your problems.

    Search perldoc, PerlMonks and CPAN. Read code out there that almost does what you want, then modify it to suit your own ends.

      ++ rhesa! Thanks. I never thought of this: Search perldoc, PerlMonks and CPAN. Read code out there that almost does what you want, then modify it to suit your own ends.
Re: Real Life Perl Exercises
by Anonymous Monk on May 27, 2006 at 21:07 UTC
    Personally, I believe that you learn any language not by studying the books, but when you actually start using it for a job/task/lesson/whatever...
    It's no use learning about hashes,for example, if you don't use them in a project... You will forget them in a couple of days. So, if you are not going to use Perl in your work or a lesson, or something else, what's the use of learning it?
    If, on the other hand, you are going to apply it, trust me, you will learn it much better each time you want to complete a task...
      what's the use of learning it? Wow! I have learned a lot of things that I don't use everyday but can pull up when the time is needed. If I lived by this philosophy, I wouldn't learn anything.

      I'm interested in programming period. Perl is fun and I want to learn more about it. Maybe one day I will use it more frequently but I have to know what it is in order to know if I even want to use it daily.

Re: Real Life Perl Exercises
by GrandFather (Cardinal) on May 27, 2006 at 21:22 UTC

    Take a look around Monastery and pick some of the Cool Uses For Perl or Snippets nodes as sources for inspiration to write some code. Treat it like an exercise where you have an answer for reference. The Code Catacombs may also be a good place to trawl through.


    DWIM is Perl's answer to Gödel
Re: Real Life Perl Exercises
by Marza (Vicar) on May 27, 2006 at 21:39 UTC

    "Real life" depends on what you do. You could try and code a database but unless you put it to use, you really won't get the full experience. Unless of course you right perfect code. ;)

    Try to automate something in your job. Try to make something easier to manage. For example, we have a sendmail server. The company makes use of mail lists and files. Rather then hand edit 300 files, I wrote a routine that would offer a menu and edit files as needed.

Reaped: Re: Real Life Perl Exercises
by NodeReaper (Curate) on May 27, 2006 at 23:22 UTC
      No thanks NodeReaper.

      If you need a machine to perform this task, perhaps you should look into some of the many drugs on the market to fix it ----- not Perl.

Re: Real Life Perl Exercises
by spiritway (Vicar) on May 28, 2006 at 00:29 UTC

    It seems to me that programming languages work much like spoken languages. No matter how much you learn the rules, the vocabulary, grammar, syntax, etc., you have to actually *use* the language before it really sinks in. Others have suggested that you find some chores you do, and write Perl programs to do them for you. I agree, this is a great way to learn. It forces you to really look hard at what the syntax is, to learn (for example) the number and order of parameters to functions, how things *really* work (as opposed to how you thought they did just by reading about it), teaches you through repetition and close examination. It also leaves you with some useful programs and scripts, if you've chosen well.

    Another thing that I've found helpful is to look at code that other Perl programmers have written - ideally programmers who are good at what they do. Try to figure out why it works, why the programmer chose to do it this way instead of another. For one thing, you can learn some very useful (or just amazingly clever) Perl idioms. For another, after you spend hours puzzling over some strange-looking code, the effort often results in knowledge beyond just that bit of code. And of course if you get stuck, there is always PM to help point you in the right direction.

Re: Real Life Perl Exercises
by xdg (Monsignor) on May 28, 2006 at 02:56 UTC
    I don't feel I know enough yet about Perl.

    The only way to learn more is to do it more. The next time you need to whip something up and think to do it in a language other than Perl, try using Perl instead.

    Be sure to search CPAN to see what you can use to make it easier. I often find that for small, 'whipupitude' programs, a CPAN module synopsis is often 75% of what I need.

    Once you get used to using modules, you can start delving into them and improving upon them as you find that they just don't work quite as you'd like.

    Other good advice can be found here:

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: Real Life Perl Exercises
by McDarren (Abbot) on May 28, 2006 at 05:15 UTC
    One thing that hasn't been mentioned is to hang around here on Perl Monks and answer some SOPW questions.

    Don't try and answer everything - try and pick those questions that you're pretty sure you know the answer to - but will strecth you just a little bit.

    Don't be afraid to post your answers, and don't be afraid to be wrong about an answer.

    You WILL get egg on your face a few times, but as long as you're prepared to be humble, and admit and acknowledge your mistakes - and learn from them - you will learn heaps.

    And at the same time you'll be contributing to a great online community.

    Cheers,
    Darren :)

Re: Real Life Perl Exercises
by sarani (Sexton) on May 28, 2006 at 06:35 UTC

    I don't feel I know enough yet about Perl.

    I don't know that one can ever know 'enough'. Musing aside, you could check out online projects (google it) in your area of interest and try to code them. Not excercises in the traditional sense - no solutions - but something to let your brain chew on. :) The other suggestions so far seem much better than this one, but this will make you feel that what you are doing is "real life".

Re: Real Life Perl Exercises
by planetscape (Canon) on May 28, 2006 at 09:00 UTC

    This question (in one of several forms - RL applications, exercises, homework, how to teach...) comes up on such a regular basis that I have compiled a list of occurrences:

    Interestingly enough, the basic advice boils down to what you have already received in this thread. :-)

    HTH,

    planetscape

      ++Awesome. Now I can bookmark just your post instead of all the others, too.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

        xdg,
        You may also be interested in Recommended Reading. Most of the interesting things I work on have to practical value for me but they teach me a lot.

        Cheers - L~R

      planetscape,
      Thank you for such a wide selection of great resources!

      You are a class act! :>)

      pmonk4ever

      "No trees were harmed in the creation of this node. However, a rather large number of electrons were somewhat inconvenienced."

Re: Real Life Perl Exercises
by zerogeek (Monk) on May 28, 2006 at 15:26 UTC
    mikasue-
    Don't feel like you are the only one wondering this. I too have finished the exercises in the Llama and was looking for more to try and sharpen my knowledge. I was actually thinking of posting this same question just yesterday!

    Thanks to you there are now some great ideas posted in this node and I have added it to my favorites.
    ++ to you!

Re: Real Life Perl Exercises
by QM (Vicar) on May 28, 2006 at 16:19 UTC
    Look at sites such as Project Euler, and other sites with organized programming problems or competitions.

    Each site has a different mix of problems and objectives, promoting a different range of skills.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Re: Real Life Perl Exercises
by merlyn (Sage) on May 28, 2006 at 19:21 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://552038]
Approved by vek
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-28 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (197 votes), past polls