Perl gives the warning:
Use of implicit split to @_ is deprecated
when used in the following code:
print scalar((split('', "I am a string"))) . "\n";
Obviously, I am not making use of
@_ in this split.
Is perl warning because I am not assigning the return value
of the
split to an array? Because if I do this:
my @chars = split '', "I am a string";
my $num = scalar(@chars);
print $num . "\n";
It does not warn.
I am not really worried about the warning because the output
('13' in this case) is correct. I was just wondering if this
is a bug, or if this is by design. And, if it is by design, why?
Or, perhaps somewhere in the parsing, perl becomes confused
with the
scalar call on the returned array of
split. I don't know. I am just wondering.
I have tried this on both perl v5.6.1 for i686-linux and
ActiveState perl v5.6.0 binary build 623 and received the same warning.
Jeremy