I'm trying to read the contents of the array and place them into the output file. I keep getting errors when I move things around and try different things. Any ideas are appreciated! Thanks! Ben#open files here my $counter = 0; my @slotarray; while ( <DPSLOTFILE> ) { my $dpdrivloc = "MSL6000 Trinity"; if ( /\Q$dpdrivloc\E:\s*(\d+)/ ) { my $slotarray{$counter} = "$1"; #print OUTFILE "$1"; $counter++; } } for (@slotarray) { print OUTFILE "$slotarray\n"; } #close files here
edit (broquaint): dropped <pre> tags
In reply to $1 into an array by jamen_98
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |