I have a string which looks likebit1,bit2,bit3,bit4and I want to count the number of bits. What I have so far ismy @bits = split /,/;
print $#bits, "\n";which works fine but do I really need to declare the array? I've tried constructs such as
print $#(split /,/) and a number of variants but I...