Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Search File

by Anonymous Monk
on Jun 08, 2011 at 14:28 UTC ( [id://908717]=perlquestion: print w/replies, xml ) Need Help??

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

I'm trying to write a perl script that prompts the user for a list of names and then searches a specific file for the fields associated with the names and then sends those fields to another file. I'm teaching myself the language and I haven't even learned C programming yet. Right now, I'm very lost. Could you please give me suggestions. Thank you very much in advance. :)

Replies are listed 'Best First'.
Re: Search File
by Guenhwyvar (Scribe) on Jun 08, 2011 at 14:52 UTC
    Start off on the right foot by picking up a copy of "Learning Perl", it'll teach you everything you need to know to complete your task.
Re: Search File
by Anonymous Monk on Jun 08, 2011 at 15:58 UTC

    Elements of Programming with Perl by Andrew L. Johnson is a really nice book (although a little older) that is meant for people getting started in programming. The author walks you through many projects similar to the one you are trying to accomplish while teaching you how to plan and think like a programmer. That said, it moves at a pretty good pace and you will not find yourself getting bored.

    Learning Perl is widely recommended to new Perl programmers and those new to programmers alike but that's a mistake. The book was written for experienced programmers with a strong UNIX background to get up to speed with the language. Given that, it actually moves at a slower pace than one would expect.

      No. _Programming Perl_ is for programmers with some experience.

      _Learning Perl_ is definitely suitable for beginners.

        From the preface of Learning Perl:
        "Although you don't need to know a single bit about Perl to begin reading this book, we recommend that you already have familiarity with such programming concepts such as variables, loops, subroutines and arrays..."

        Elements of Programming with Perl goes covers all of these fundamental concepts as well as teaching beginners how to break down problems into pseudo code and translating it to Perl. There are 'real life' projects in the book like figuring out payroll as opposed to playing fetch with Dino for a few hundred pages.

        I know it's a popular book, written by a popular Perl personality but I wish people would stop recommending Learning Perl to beginners with little to no programming background.

Re: Search File
by pobocks (Chaplain) on Jun 09, 2011 at 05:50 UTC

    I'm going to second the suggestion to pick up Learning Perl, or, anyway, some introductory programming text.

    If you haven't done any programming, you're really going to want to get a book aimed at teaching basic programming background in a language, rather than trying to just pick up a language and run with it. For Perl, Learning Perl would be that book.

    for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://908717]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found