in reply to Use of implicit split to @_ is deprecated

The reason for this warning is that split is creating a list in @_, and then you're evaluating that @_ array in scalar context. This has the effect of counting @_'s elements, but has the side effect of wiping out whatever happened to be in @_ beforehand. Because this is a common cause of grief for people who didn't realize they're clobbering a subroutine's parameter list, a warning is issued to alert the programmer that (s)he may be creating a hidden bug. Moreover, the entire notion of splitting into @_, because of its inherent risks, has been deprecated (discouraged... dis-recommended).

The obvious solution is to not use some contrived solution like this when Perl has a perfectly good length function. What we don't know from the code snippet you provided is if the original code actually relies on @_ containing the results of the split.

You've got one other serious problem, and that's the use of a dot (concatenation operator) where you probably intended to use a comma (list operator). Because your code has a dot where a comma belongs, Perl silently translates what you've got there into the following (use "perl -MO=Deparse scriptname.pl" if you don't believe me):

$var_cellsplit = split( ( // . $var_cellname ), $_, 0 );

Why this isn't a syntax error is a little perplexing, but the result is that your "split" regexp looks pretty funky, and instead of splitting $var_cellname, you're splitting the contents of $_. This is a BIG hidden bug.


Dave