http://www.perlmonks.org?node_id=1003834


in reply to Using perl to extract data from multiple .txt files

open my $OUT, '>', 'output.txt' or die "output: $!"; for my $file (glob 'dir/*.txt') { # Your old code here. Remove opening the output file. }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Using perl to extract data from multiple .txt files
by MidLifeXis (Monsignor) on Nov 14, 2012 at 15:46 UTC

    Careful with this one to make sure that you (the OP, not choroba) do not process the text file opened above.

    --MidLifeXis

      True. I added a path to the code (I had planned to, but forgot).
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ