in reply to Re^3: reading files to different output files.
in thread reading files to different output files.
first of all, thank you for your effort :) I wrote another program and I'm sure I am nearer to the solution than ever. However, it doesn't do anything:
#! usr/bin/perl use strict; use warnings; use IO::File; my @out; my @file_names = ("output1.txt", "output2.txt", "output3.txt"); my $i = 0; while (<>){ foreach (@ARGV){ open (READ, $ARGV) || die "Cannot open $ARGV: $!.\n"; $out[$i] = IO::File->new( ">file_names[$i]" ) || die "Cannot o +pen file_names[$i]: $!.\n"; $i++; while ( <READ> ){ print {$out[$i]} "$_"; } } }
so what's the problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: reading files to different output files.
by choroba (Cardinal) on May 31, 2017 at 14:53 UTC | |
|
Re^5: reading files to different output files.
by shmem (Chancellor) on May 31, 2017 at 15:40 UTC |