Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

New to perl

by Monk_perl
on Mar 14, 2011 at 19:43 UTC ( #893128=perlquestion: print w/ replies, xml ) Need Help??
Monk_perl has asked for the wisdom of the Perl Monks concerning the following question:

Hi friends : All these 14 Q's are from my last year exam paper i took from library and i am trying to solve them ...i want to solve them in a very best way so if they will come in exam this time again then i would answer them most happyily. Please help me . 1 Describe the main features of perl .What are its characteristics which makes it suitable for Bioinformatics ? 2 What is a file handle ? How they are similar to streams ? 3 What are scalar variables ?Discuss various types of variables used in perl with examples. 4 Describe named Unary and file operators with examples. 5 Write a perl program that asks the user to enter a name and a number n and prints the nth letter in the name. 6 what are global and scoped declarations in perl ? Write perl script to explain the same . 7 How we do loop control with next last and redo ? Where we should use them and where not ? 8 What are regular expressions ? Explain in detail its most important elements ? 9 Write a perl program which takes file name as arguments and counts lines in file with (a) Letter X (b) String the 10 What are subroutines ? How it differs from a procedure ? Explain with example how parameters are passed in subroutines. 11 Write a perl program which reads a file into a hash array. 12 Write a perl script which compares and concatenates two strings. 13 What for formats are used in perl ? How we can access formatting internals ? 14 What are hashes ? Describe all functions relevant to hashes.

Comment on New to perl
Re: New to perl
by ikegami (Pope) on Mar 14, 2011 at 19:51 UTC
    How about you give your answers, and we'll review them.
      Guess that made us both brothers. you are welcome on board. in case you are able to fine your ways round perlmonks please teach me what you've learn t. good luck
Re: New to perl
by Anonymous Monk on Mar 14, 2011 at 19:55 UTC

      Thanks for telling

Re: New to perl
by Corion (Pope) on Mar 14, 2011 at 19:59 UTC

    Why do you claim (to be) "New To Perl" and in the same post claim to have done Perl last year in your exam paper? This does not mesh well, and I think at least one of the things you're trying to tell us is not true.

      Most likely Monk_perl means that exam papers from previous years are available and the questions listed are from last year's exam which Monk_perl would like to use as a practise exam.

      True laziness is hard work
      I claim (to be)"new to perl" just to tell that i don't know anything about it because i didn't study it...and i have last year Question paper which means i am "new to perl" and i checked last year papers to know what kind of Questions come in exam!
Re: New to perl
by kennethk (Monsignor) on Mar 14, 2011 at 20:22 UTC

    All these 14 Q's are from my last year exam paper i took from library and i am trying to solve them
    Thank you for frankly explaining where these questions are coming from. Rather than explicitly answering them, I will give some quick pointers into the docs. Some of these questions are unclear to me; whether that is a problem with your transcription or the original, I cannot say.

    1. Describe the main features of perl .What are its characteristics which makes it suitable for Bioinformatics

      perlintro, http://www.bioperl.org/wiki/HOWTO:Beginners

    2. What is a file handle ? How they are similar to streams

      perlopentut

    3. What are scalar variables ?Discuss various types of variables used in perl with examples.

      perldata

    4. Describe named Unary and file operators with examples.

      perlop

    5. Write a perl program that asks the user to enter a name and a number n and prints the nth letter in the name.

      Hint: substr

    6. what are global and scoped declarations in perl ? Write perl script to explain the same .

      Declarations in perlsyn

    7. How we do loop control with next last and redo ? Where we should use them and where not ?

      Loop Control in perlsyn, redo, last, next

    8. What are regular expressions ? Explain in detail its most important elements ?

      perlre, perlretut

    9. Write a perl program which takes file name as arguments and counts lines in file with (a) Letter X (b) String the

      Everything you need is in the above links

    10. What are subroutines ? How it differs from a procedure ? Explain with example how parameters are passed in subroutines.

      perlsub

    11. Write a perl program which reads a file into a hash array.

      Everything you need is in the above links

    12. Write a perl script which compares and concatenates two strings.

      Everything you need is in the above links

    13. What for formats are used in perl ? How we can access formatting internals ?

      I do not know what this means; do they mean perlguts or perhaps sprintf? Maybe IO Layers?

    14. What are hashes ? Describe all functions relevant to hashes.

      perldata

    If you are preparing for a test, where you found an old test in the library, your new test will likely not have the same questions on it; by gaining familiarity with the Perl documentation, you will prepare yourself for the next test, not the previous one.

        Better yet, use Perl6::Form, which brings Perl6-style forms to Perl5. Less magical and much cleaner than the builtin forms.

      Write a perl program that asks the user to enter a name and a number n and prints the nth letter in the name? Hint: substr

      I read substr but i didn't see how it can be user operated program.

      I think question asks the user to enter value of n to print the letter or character from the string defined in the program.

      i want that program should ask the user on the command line to enter name and number n to print its corresponding letter, isn't it that i think about question ?

        We seem to be going round in circles here. If you do want to learn perl, read and understand the replies you've previously been given, work (yes, work. Don't just read them, make sure you understand what they're saying and how the code works) through the examples given in Getting Started with Perl from the tutorials section. If there is something you don't understand, you're going to have to specifically tell us, otherwise we'll never know.

        My advice would be to stop posting exam questions and actually spend your time learning this. You say you have an exam to do, was there was an associated course? If so you should have notes. Do you have a teacher of some kind you could ask?

        i want that program should ask the user on the command line to enter name and number n to print its corresponding letter, isn't it that i think about question ?
        And I want a pony. But nobody on this website is going to give me one. Does that seem unfair?

        In order to achieve your desired result, you need to break it down to basic steps that are easily programmable - this will be your algorithm. In this case, I would:

        1. Obtain a name from the user, via STDIN (I/O Operators)
        2. Obtain an index from the user, via STDIN
        3. Use substr to obtain the n-th letter of the name
        4. print that character to STDOUT

        If you follow the extensive assistance you received in how to create a perl program using filehandle and streams ?, you should be able to achieve 1. and 2.

        This site is full of people who are patient, friendly and generous with their valuable time - time that is more valuable than yours in a very literal way. Your apparent lack of effort is rapidly burning bridges here. I caution you to consider this before posting again. How do I post a question effectively?.

Re: New to perl
by marto (Chancellor) on Mar 14, 2011 at 20:46 UTC

    I don't believe your story, either about taking this exam paper from a library, or that you have tried in any way to solve them. If you had done so, you'd have posted your answers here asking us to comment on them.

    I suspect you are either being given this task as coursework/homework that you've not bothered to do, or that this is part of an interview scenario which I know for a fact some companies issue. I've seen posts on various forums from people asking for the answers to such interview questions posed by multinational outsourcing companies.

    If you take short cuts like this with your education or to gain employment, not only do you learn nothing you'll potentially put yourself under a lot of pressure. Do yourself a favor, either go learn this stuff or don't bother. You've previously been advised how to get started in your previous thread.

    Update:Also read How do I compose an effective node title? and How do I post a question effectively?.

      I wrote these questions from my library wherefrom the book titled previous year question papers i picked and noted these questions. So i take it as model question paper for my exam preparation. I didn't tried to solve them because i have difficulty concluding the answers ...i have not studied perl so it may take time for me to solve them so i took shortcut here.well i am studying them now and i would show you answers to have them checked from you Friends!

Re: New to perl
by Anonymous Monk on Mar 14, 2011 at 21:41 UTC
    All these 14 Q's are from my last year exam paper i took from library and i am trying to solve them .

    It actually looks like you're asking us to solve them.

      Yes i am confused so i asked here!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-07-23 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (153 votes), past polls