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

Re: [PATCH] Remove implicit split to @_

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
July 9, 2009 23:11
Subject:
Re: [PATCH] Remove implicit split to @_
Message ID:
20090710081141.1c362e05@pc09.procura.nl
On Thu, 9 Jul 2009 21:28:14 -0700, Chip Salzenberg <chip@pobox.com>
wrote:

> This is an amusing discussion.
> 
> The only problem that I observe with scalar split writing to @_ implicitly
> is that it's an easy thing to do by accident and is almost never useful.
> Therefore, removing it seems a public service.
> 
> I favor simply making it a compile-time error to use split in scalar
> context.  No problem with silently changing semantics and no more surprising
> behavior.  Everybody's happy.  (right?)

we can still support void context?

  split /foo/;		# @_ = split /foo/, $_;
  $a = split /foo/;	# $a is the count

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

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