> Given:
> 
> #!perl
> while(<DATA>){
> 
>    for $x(split//){
> 
>      print "X:$x S:$#_ \n";
> }}
> __END__
> 1963
> 
> 
> Why is $#_ a -1 ???

>From perlfunc:

       In scalar context, returns the number of fields
       found and splits into the @_ array.  Use of split
       in scalar context is deprecated, however, because
       it clobbers your subroutine arguments.


This is not scalar context. So no assignment to @_ is made.

--Ala

Reply via email to