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

Hello Monks.
I need to match certain lines on one file and print the corresponding arrays on other file. Any suggestion?

Replies are listed 'Best First'.
(kudra: we know nothing until you tell us) RE: Array Prob.
by kudra (Vicar) on Aug 07, 2000 at 21:16 UTC
    Here's an example of what eduardo may have meant by suggesting you be more specific. Walking through what you wrote, you can see many questions are raised:
    I need to match certain lines from a file
    1. Do you have the file already? Do you need help on opening it?
    2. What kind of matching do you need to do? Are you asking for a regex for a specific problem, or are you asking for a general solution, such as 'you can accomplish this with a regex'?
    and print the corresponding arrays
    1. What corresponding arrays? You were talking about matching lines...where do the arrays come from?
    on other file
    1. Again, have you got this part taken care of, or do you need help with opening the file and outputting to it?
    In addition to clarifications of the problem, seeing the code in question, the error messages you're getting, and a summary of what you've attempted will help someone trying to offer a solution.

    As you can see, it's very difficult for us to answer when you don't provide information about your problem--thus it is not a simple question to answer. It's good that you were able to find your answer because I don't think anyone could help you without more clarification. This node may give you suggestions on how to create a question. If you post any code, you'll also want to look at Site How To, where there's a section on submitting Code and Escaping Characters.

    Remember, all we know of your problem and context is what you tell us, so be specific.

Re: Array Prob.
by eduardo (Curate) on Aug 07, 2000 at 19:28 UTC
    ok, and i know i'm about to get --'d for this but... yeah, here is a suggestion:
    1. LEARN TO POST QUESTIONS WHICH ARE AT LEAST COMPREHENSIBLE!!!!
    2. how about some sample code, sample ideas, what are you thinking?
    3. give us some background, why are you trying to do this very "gee, let's see if the people on perlmonks do my homework" task?
    4. see #1
    ok... sorry... i'm just really grumpy about people trying to freeload through a CS education... if however, this was a real question, and you expect real answers. Give us a real description of the problem, what the files look like, what your arrays look like, what it is you are trying to accomplish, and where you are getting lost... k?
      GEE! sorry!! I thought this site was helpful for perl begineers. May be not..It was just a simple question. You didn't have to get that mad..I don't even need code . I just wanted some ideas. Bye monks.
        this site is very helpful for perl beginers, as a matter of fact, i don't know of any community that i've ever been in that is more accepting of the un-initiated! however, we expect you to put up your 1/2 of the work if you expect us to do the rest. All i said in my answer to you was:
        • give us a good problem defenition
        • give us a good background
        • and tell us how far you've gotten
        • tell us what the problem you've encountered is

        and if you give us that... we'll do our best!