E
ela
While I succeeded in producing generic file names, I found that I cannot
name the file pointer ($PROBLEMFP in the following codes) generically. I
have to keep unknown number of file pointers (depending on the number of
lines in modellist, not known beforehand) open and therefore I have to
create "n" $PROBLEMFP's. Is it possible to achieve this in Perl?
#!/usr/bin/perl
my ( $iteration, $modellist ) = @ARGV;
open( my $FPM, '<', "$modellist") or die "could not open '$modellist' $!";
$lineM = <$FPM>;
@models = split(/\t/, $lineM);
foreach (@models) {
$modelscript = $_ . "_script.txt";
$modellog = $_ . ".log";
##########################
open( my $PROBLEMFP, '>', "$modelscript") or die "could not open
'$modelscript' $!";
}
name the file pointer ($PROBLEMFP in the following codes) generically. I
have to keep unknown number of file pointers (depending on the number of
lines in modellist, not known beforehand) open and therefore I have to
create "n" $PROBLEMFP's. Is it possible to achieve this in Perl?
#!/usr/bin/perl
my ( $iteration, $modellist ) = @ARGV;
open( my $FPM, '<', "$modellist") or die "could not open '$modellist' $!";
$lineM = <$FPM>;
@models = split(/\t/, $lineM);
foreach (@models) {
$modelscript = $_ . "_script.txt";
$modellog = $_ . ".log";
##########################
open( my $PROBLEMFP, '>', "$modelscript") or die "could not open
'$modelscript' $!";
}