Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: appending to a file

by lomSpace (Scribe)
on Mar 19, 2009 at 21:56 UTC ( #751887=note: print w/replies, xml ) Need Help??


in reply to Re^3: appending to a file
in thread appending to a file

I want to append the three files to my $out file.
I only need each file appended once. The loop is appending each file
four times. Any ideas?

Replies are listed 'Best First'.
Re^5: appending to a file
by Nkuvu (Priest) on Mar 19, 2009 at 22:09 UTC

    Without a fair bit of rewriting your original code, you can add a last; after the final call to close() -- this will exit the for my $f(@files) loop.

    This isn't the way I'd write the script, personally, but I don't know enough about your file structure to revise it accurately. I'd probably use File::Find to make this a bit simpler.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://751887]
help
Chatterbox?
[shmem]: Discipulus: oh. tatsächlich.
shmem missed his monkday yesterday :P - 12 years and way to go...
[1nickt]: Happy Monkday shmem. I was at my stepson's birthday party and thought of you.
[virtualsue]: holli about half
[choroba]: "Tatsächlich, das ist die Knochenstruktur eines Bettlers!" ??
shmem bows. Thank you
[marto]: slowclap.gif
[marto]: animated gif in question...
[1nickt]: Interesting article on the Coming Software Apocaplyse that I found while following one of eyepopslikeamosqui to's posts. Posits that no one can guarantee the quality of, or even understand, the 100 million lines of code in a mo
[holli]: you know, monk days are fun and all. but too many of them are bad for your health

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2017-11-21 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (301 votes). Check out past polls.

    Notices?