dimmesdale has asked for the wisdom of the Perl Monks concerning the following question:
I don't understand it, because $i_file opens normally, and the only difference between $i_ and $o_file is the '>'. I don't even know what comma it's talking about!
#!/usr/bin/perl use warnings; use strict; my $i_file = "faster_averages.txt"; my $o_file = ">ordered_averages.txt"; my @i; my $j = 0; my @CCFN; my @CCFN_NT; my @EBG; my @EBGFN; my @PR; my @PRFN; my @BL; my @BLSTDG; my @BLSTDGG; my @output; open(IN, $i_file) or die "$i_file failed to open: $!"; my @lines = <IN>; close IN; for my $file ((split /\t/, @lines)[0]) { if($file =~ /CCFN\d+NT/) { $CCFN_NT[$i[0]++] = $lines[$j] } if($file =~ /CCFN/) { $CCFN[$i[1]++] = $lines[$j] } if($file =~ /EBGFN/) { $EBGFN[$i[2]++] = $lines[$j] } if($file =~ /EBG/) { $EBG[$i[3]++] = $lines[$j] } if($file =~ /PRFN/) { $PRFN[$i[4]++] = $lines[$j] } if($file =~ /PR/) { $PR[$i[5]++] = $lines[$j] } if($file =~ /BLSTDGG/) { $BLSTDGG[$i[6]++] = $lines[$j] } if($file =~ /BLSTDG/) { $BLSTDG[$i[7]++] = $lines[$j] } if($file =~ /BL/) { $BL[$i[8]++] = $lines[$j] } $j++; } @output = (@CCFN,@CCFN_NT,@EBG,@EBGFN,@PR,@PRFN,@BL,@BLSTDG,@BLSTDGG); ######## # Right here open(OUT, $o_file) or die "$o_file failed to be created: $!"; # $o_file defined above ######## print OUT, @output; close OUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with perl error message
by particle (Vicar) on Jun 25, 2002 at 13:18 UTC | |
|
Re: Help with perl error message
by RMGir (Prior) on Jun 25, 2002 at 13:18 UTC | |
|
Re: Help with perl error message
by Zaxo (Archbishop) on Jun 25, 2002 at 13:21 UTC | |
|
Re: Help with perl error message
by frankus (Priest) on Jun 25, 2002 at 13:21 UTC |