Hello,
Trying to remove from array blank lines, its look like splice get
confuse with the array size after removing the blank entry.
Or maybe I'm getting confuse..
Thanks
Dov
use strict;
my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8,
$str9,)
=
(
"000000000000000000000000000000000",
"111111111111111111111111111111111",
"222222222222222222222222222222222",
"333333333333333333333333333333333",
"444444444444444444444444444444444",
"",
"",
"",
"",
"999999999999999999999999999999999",
);
my $ref_array = [ $str0, $str1, $str2, $str3, $str4, $str5, $str6,
$str7, $str8, $str9,];
foreach my $indx (0..$#$ref_array) {
if ($ref_array->[$indx] =~ /^$/) {
splice (@$ref_array, $indx, 1);
}
}
foreach my $indx (0..$#$ref_array) {
print $ref_array->[$indx] . "\n";
}
exit (0);