Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Copy data from one file and add it to another

by wade (Pilgrim)
on Apr 25, 2008 at 22:11 UTC ( #682931=note: print w/ replies, xml ) Need Help??


in reply to Copy data from one file and add it to another

Hmmm. That looks like homework. You really should state that going in but you deserve kudos for giving it a shot before asking. Given that this is homework, though, I'm only going to give you hints.

First, you should always:

use strict; use warnings; use diagnostics;

Next, you probably want to use the 3-argument version of open:

open(INFO, "<", "$infile") or die ("could not open file to append".$!) +; open(FILEA, "<", "outputfromvariantparser1.txt") or die ("could not op +en file to write output"); open(FILEB,">>", output.txt") or die ("could not open file to write ou +tput");

You should probably lookup 'open' -- I see a problem with more than one of your files. (hint: one of the translations I did, above, does what your original code did but clearly doesn't do what you intend).

I don't think you want to nest your loops.

You'll need to figure out how to cycle through 'raw_data'

Edit: I made one hint a little clearer.

--
Wade


Comment on Re: Copy data from one file and add it to another
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-12-25 03:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls