in reply to Uninitialized Value
As you go through the last foreach loop, you (might) assign $_ to specified elements of @data. On line 49, you print all the elements of @data - some of which are obviously uninitialized.
You can initalize them with something like the following:
To have it start it's life with 5 empty strings.my @data = ('','','','','');
Also, consider moving the open/close statemens outside of the foreach loop.
Since you're appending to the output file, you might as well just open it once and be done with it.open STDOUT, ">>", "$output0" or die "$output0: $!\n"; foreach (@list) { ... print STDOUT, @data; } close STDOUT;
Update: Fastolfe pointed out that the initialization should have been with the empty string instead of undef...thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Uninitialized Value
by Fastolfe (Vicar) on Dec 15, 2001 at 00:23 UTC |