in reply to Re: print out
in thread File names with interpolated variables

i plan on dealing with a 1000 files so not necessary suitable, perhaps a way of using a counter??

Replies are listed 'Best First'.
Re^3: print out
by ikegami (Patriarch) on Sep 23, 2004 at 20:54 UTC

    yes:

    my $filename; my $counter; foreach $filename (@filelist) { open(IN, '<', $filename) or do { warn("Error opening $filename."); next; }; $counter++; print OUT ("${counter}: $_") while (<IN>); close(IN); }
      thanks came to a solution
      while (<>) { my $i++; something open (OUT, ">newnames.$i");
Re^3: print out
by Anonymous Monk on Sep 23, 2004 at 20:52 UTC
    so output files would be named out1 out2 ... out100

      You lost me there. You have multiple input files AND multiple output files? What do you want in which output file?