points out, my question is : how to get rid of the warning.
And in as few keystrokes as possible, without a significant time overhead.
Finally, I decided to try the obvious solution : turn off warnings locally.
my $n = scalar split ',', $str;
This does the job and costs almost nothing in time, as the expanded benchmark shows:
Use of implicit split to @_ is deprecated at H:\dev\perl\perlmonks\ben
+ch.pl line 23.
Benchmark: timing 10000 iterations of split_anonymous, split_simple, s
split_anonymous: 24 wallclock secs (15.55 usr + 0.00 sys = 15.55 CPU)
+ @ 643.00/s (n=10000)
split_simple: 20 wallclock secs (12.23 usr + 0.00 sys = 12.23 CPU) @
split_simple_quiet: 18 wallclock secs (12.15 usr + 0.01 sys = 12.16 C
+PU) @ 822.57/s (n=10000)
Rate split_anonymous split_simple split_si
split_anonymous 643/s -- -21%
split_simple 818/s 27% --
split_simple_quiet 823/s 28% 1%