in reply to Re^4: How to create an output file for each input file
in thread How to create an output file for each input file

Rather than

$verifile = $outbox.$yr.$mn.$day.$hr.$min.$sec."_FIXED.TAB";
use something like
$verifile = $outbox."_".$yr.$mn.$day."_".$hr.$min.$sec."_FIXED.TAB";

(Keep it mind you have to populate the date and time fields.)

You create the file by opening it. You should look at this tutorial on Open to decide exactly what you want to do.

Replies are listed 'Best First'.
Re^6: How to create an output file for each input file
by Anonymous Monk on Apr 02, 2008 at 23:10 UTC
    Thanks for the document. When I run my code (with variables defined) I am able to open a new file, but instead of it closing and then a second file being created, the dumby data is appended to the original single file. Is that because I'm using

    open(OUTPUT_FILE, ">>$verifile")||die "Can't open file: $!";

    close OUTPUT_FILE;
      '>>' says "append to an existing file". I believe a single '>' says 'create if necessary, over-write if it already exists'.

      When you do the print, do you print OUTPUT_FILE?

      If you post your current code, I (or someone else; it's bedtime for me) could better comment.

        I'm slowly piecing it together. Thanks so much for your insight, I'll share more later, getting late here too.