in reply to split giving warning

Remember the three commandments of the Perl religion:
use warnings; use strict;

Did I say three commandments? Yes, the third one is

use diagnostics;

when you're stumped with a message perl throws at you. In your case, with use diagnostics enabled, you'll get

Use of implicit split to @_ is deprecated at ./t line 7 (#1) (D deprecated) It makes a lot of work for the compiler when you clobber a subroutine's argument list, so it's better if you assign the results of a split() explicitly to an array (or list).

So ... just assign the list returned by split() to an array, and the warning goes away.

-- saintmike

Replies are listed 'Best First'.
Re: Re: split giving warning
by ysth (Canon) on Mar 22, 2004 at 07:47 UTC
    The text that use diagnostics shows is also available via perldoc perldiag. You can also run the splain utility and type in the error message for it to do the lookup for you.