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]};

The 'scalar' is optional, but I like it for readability.

  • Comment on Re: How to get the number of fields found by split without a warning?
  • Download Code