M
Mark J Fenbers
$myline = "0,1,2,3,4,,,,";
@myarray = split /,/, $myline;
print scalar @myarray; # prints 5
$myline = "0,1,2,3,4,,,,8";
@myarray = split /,/, $myline;
print scalar @myarray; # prints 9
In database output, sometimes the last field(s) in a record is(are) null, and so
the line looks like the first $myline. Other times, the last field is not null,
and so the line looks like the second $myline. Is there a way that I can get
Perl to report that scalar @myarray is 9 even if there are trailing null fields?
Mark
@myarray = split /,/, $myline;
print scalar @myarray; # prints 5
$myline = "0,1,2,3,4,,,,8";
@myarray = split /,/, $myline;
print scalar @myarray; # prints 9
In database output, sometimes the last field(s) in a record is(are) null, and so
the line looks like the first $myline. Other times, the last field is not null,
and so the line looks like the second $myline. Is there a way that I can get
Perl to report that scalar @myarray is 9 even if there are trailing null fields?
Mark