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

So recently I have been hired to write a program, but this time it was in Perl and I am completely unfamiliar with the script and am having trouble getting going on it. My employer provided me with the Perl books, I worked my way through the short one but once I hit the huge one I decided to see if I could pick out just what I needed to know, well the things I needed to know where at the end of the book and it seemed like you needed to know everything prior to that. Well enough chit-chat, here is the gist of what I have to do: experiments are carried out step by step and at each step about 10 different values are returned to the computer. Every step is listed one after the other in a text file. So what I'm supposed to do is open this text file, find each step, grab the values of temperature and time increment only and put the three into a list on a new text doc. So not knowing a lot of perl I'm kind of lost right now as to how to attack it. I am unfamiliar with the way in which perl opens a text file and how I can search it to pull out the necessary values. For additional reference the text file I need to open is called 'hout.txt' and I am working on windows just writing scripts in notepad. Thanks in advance.

Replies are listed 'Best First'.
Re: Trouble Getting Started
by bart (Canon) on May 26, 2005 at 15:36 UTC
    I'm kind of lost right now as to how to attack it. I am unfamiliar with the way in which perl opens a text file and how I can search it to pull out the necessary values.

    Have you seen the online book Beginning Perl? In particular, chapter 6 will probably answer your questions about files. As for pulling out data: I'm not entirely clear on exactly what you want to do, but do take a look at chapter 5 on regular expressions.

    And there are sites and mailing lists dedicated to complete newbies, do take a look at http://learn.perl.org.

Re: Trouble Getting Started
by Transient (Hermit) on May 26, 2005 at 15:36 UTC
    You're probably best off starting here:

    perlopentut

    And reading other tutorials as the need arises.
Re: Trouble Getting Started
by prasadbabu (Prior) on May 26, 2005 at 15:35 UTC
Re: Trouble Getting Started
by gman (Friar) on May 26, 2005 at 16:38 UTC
    Don't discount looking at other people’s examples.
    There are thousands of examples here also that can get
    you started. Just try searching this site for "opening files" and you will
    see what I mean.

    Good luck
Re: Trouble Getting Started
by zentara (Cardinal) on May 26, 2005 at 18:52 UTC
    Usually when you are beginning, you want to see easy examples. Go to "http://groups.google.com" and search for them. For instance search for " perl open text file", or "perl write text file". You will be amazed at all the code just floating around out there. You will eventually learn how to phrase your search queries to get the best results.

    I'm not really a human, but I play one on earth. flash japh