# Create an array of file handles my @fhs; for my $file (qw (gash1.txt gasg2.txt gash3.txt) { open (my $fh, '>', $file) or die "Unable to open $file: $!"; push @fhs, $fh } # Now for the print print $_ "Some stuff\n" for @fhs; print $_ "Some more stuff\n" for @fhs; # Close the files close $_ for @fhs;
In reply to Re: writing in 2 handles
by cdarke
in thread writing in 2 handles
by nagalenoj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |