On Tue, Nov 25, 2008 at 4:39 PM, Sherwin Daganato
<[EMAIL PROTECTED]> wrote:
>
>
> On Tue, Nov 25, 2008 at 1:03 PM, Ludwig Isaac Lim <[EMAIL PROTECTED]>
>>  $varn  [EMAIL PROTECTED]<number>];
>>
>>  (method 2)
>>
>>   ($var1,$var2,$var3) = split /\s+/,@arr,3;
>
> Passing an array as the second argument to split() and  expecting split()
> to return a list is wrong. @arr will be evaluated in scalar context. Thus,
> what will be passed to split() is the length of @arr.

Yes, perldoc -f split has these "function prototypes" for split():

       split /PATTERN/,EXPR,LIMIT
       split /PATTERN/,EXPR
       split /PATTERN/
       split

EXPR is taken as a scalar, and when not present, the default scalar $_
is assumed to be split.

-- 
Zak B. Elep  ||  http://zakame.spunge.org
[EMAIL PROTECTED]  ||  [EMAIL PROTECTED]  ||  [EMAIL PROTECTED]
1486 7957 454D E529 E4F1  F75E 5787 B1FD FA53 851D
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to