in reply to Re^3: Print to specific line
in thread Print to specific line
But even if such is the case, still, there is no need for duplicating the data.
My view is that using an array to store the data is the simplest choice. But I would still add code to prevent spurious warnings for undefined values, for example something like:
But even with a hash, it is quite simple to do more or less the same thing:for my $i (0..$#array) { print defined $array[$i] ? "$array[$i]\n" : "\n"; }
for my $i (0..$max_hash_key) { print defined $hash{$i} ? "$hash{$i}\n" : "\n"; }
|
|---|