Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Getting duplicate file contents in perl

by BillKSmith (Monsignor)
on Sep 13, 2021 at 13:38 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found