vyeddula has asked for the wisdom of the Perl Monks concerning the following question:

As a perl beginner i am looking to exercise my understanding w.r.t Scalars,Loop controls,Arrays,Hashes and Functions.If possible please assign me some puzzles to solve in Perl to cover above areas.May be 5-10 question to hone the logic to start with.Thanks

Replies are listed 'Best First'.
Re: Perl Puzzles
by 2teez (Vicar) on Jun 07, 2013 at 18:35 UTC

    Hi vyeddula,
    This thread Small Perl quests for a beginner? may be of help. There are several links to questions you can try your hands on.
    Please check it.

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
Re: Perl Puzzles (books)
by Anonymous Monk on Jun 07, 2013 at 18:14 UTC
Re: Perl Puzzles
by AnomalousMonk (Archbishop) on Jun 08, 2013 at 12:20 UTC

    I think you will find that Seekers of Perl Wisdom is itself a treasure trove of over a million questions that are candidates for beginner exercises.

    Granted, sometimes the biggest problem is to figure out what the original poster meant to ask in the first place. Once this is clear, you will frequently find that the question is too specialized or subtle to use as a beginner's exercise.

    Once these hurdles are passed, you will often find yourself with a question in hand that is both clear enough and fundamental enough to be enlightening. Without looking at the answers of others, provide your own answer. Look through the documentation to provide support for your answer. (Becoming familiar with the extensive documentation provided with Perl both on- and off-line is valuable in and of itself.) Write some small code examples! (Note that the word examples is plural; variations on working code are often instructive and may produce enlightening extensions to the original question. Play with the code!) Then, and only then, look at the answers to the question provided by others. Then start over: check their documentation links; test and vary their code examples; etc.

    I go through SoPW looking for regex-related questions with precisely this attitude. I may not come up with an answer that is original or particularly helpful to the OPer, but I will often benefit myself!

    May your quest(ion)ing be fruitful!

Re: Perl Puzzles
by smls (Friar) on Jun 07, 2013 at 18:02 UTC
    Puzzle 1:
    Explain what the following code does...
    my @list2 = sort keys %{ { map { $_ => 1 } @list1 } };

    (Not sure if this is what you had in mind, and if it's the right level of difficulty. Specify if not.)

Re: Perl Puzzles
by saurabh2k26 (Initiate) on Dec 01, 2014 at 15:54 UTC