develooper Front page | perl.perl5.porters | Postings from July 2009

Re: [PATCH] Remove implicit split to @_

Thread Previous | Thread Next
From:
Yitzchak Scott-Thoennes
Date:
July 10, 2009 16:55
Subject:
Re: [PATCH] Remove implicit split to @_
Message ID:
61729.97.113.117.246.1247270107.squirrel@webmail.efn.org
On Fri, July 10, 2009 11:12 am, Eric Brine wrote:
> On Fri, Jul 10, 2009 at 1:45 PM, Yitzchak Scott-Thoennes wrote:
>> $count = () = split(/PATTERN/, EXPR) doesn't work, but
>> $count = () = split(/PATTERN/, EXPR, -1) does.
>
> Could this be added to the docs, please?

Already there, http://perldoc.perl.org/functions/split.html:

split /PATTERN/,EXPR,LIMIT...If LIMIT is specified and positive, it
represents the maximum number of fields the EXPR will be split into...If
LIMIT is negative, it is treated as if an arbitrarily large LIMIT had been
specified...When assigning to a list, if LIMIT is omitted, or zero, Perl
supplies a LIMIT one larger than the number of variables in the list

although I'm not quite certain what the "this" you meant is.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About