On Fri, Jul 9, 2010 at 5:16 AM, marcos rebelo <ole...@gmail.com> wrote:
> the fact of or not the prototype in the xpto function, I get this
> warning: 'Use of implicit split to @_ is deprecated at script.pl line
> 5.'
>
> use strict;
> use warnings;
>
> sub xpto($) {};
> xpto( split(/\n/, "fv\nfg" ) );
>
I believe the code is calling "split" in a scalar context. Scalar context
returns the number of elements - not the different elements. Making "xpto"
take a list as its parameter stopped the warning message. So according to
the warning message, "split" should not be called in a scalar context.
use strict;
use warnings;
sub xpto(@) {};
xpto( split(/\n/, "fv\nfg" ) );
--
Robert Wohlfarth