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

Re: Getting duplicate file contents in perl

by BillKSmith (Monsignor)
on Sep 13, 2021 at 13:38 UTC ( #11136718=note: print w/replies, xml ) Need Help??


in reply to Getting duplicate file contents in perl

Your output file is already in the directory when you glob so your output file is treated as an input. Move the glob before the open.
my @allFiles = glob("$severityDir/*.txt"); open( my $fh, '>>', $severityFile ) or die "Could not open file '$severityFile' $!";
Bill

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2021-11-27 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?