in reply to How to get the number of fields found by split without a warning?
You can get this without a dummy array assignment with:
my $n = scalar @{[split ',', $str]}; [download]
The 'scalar' is optional, but I like it for readability.