jamen_98 has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $1 into an array
by Wonko the sane (Curate) on Mar 25, 2004 at 19:32 UTC | |
|
Re: $1 into an array
by jeffa (Bishop) on Mar 25, 2004 at 19:43 UTC | |
|
Re: $1 into an array
by Enlil (Parson) on Mar 25, 2004 at 19:51 UTC | |
by jamen_98 (Initiate) on Mar 26, 2004 at 19:40 UTC | |
|
Re: $1 into an array
by bageler (Hermit) on Mar 25, 2004 at 19:44 UTC | |
|
Re: $1 into an array
by TomDLux (Vicar) on Mar 26, 2004 at 19:40 UTC |