The problem is that you reopen c.txt for output '>c.txt', which overwrites the file, and then print to the terminal.
If you wish to keep the original contents of c.txt and append to it, reopen the file for append '>>c.txt'.
And either way, you need to say where you want your output to go by adding the file handle to the print line
foreach (keys %tagdict){ print CF values %tagdict if exists $tagcorpus{$_}; } # ^^ Here!
In reply to Re: File write
by BrowserUk
in thread File write
by perl_seeker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |