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

Re: split in scalar context [was: Alarums and Excursions]

Thread Previous
From:
Yitzchak Scott-Thoennes
Date:
July 29, 2008 13:48
Subject:
Re: split in scalar context [was: Alarums and Excursions]
Message ID:
35612.71.212.97.166.1217364507.squirrel@webmail.efn.org
On Tue, July 29, 2008 12:30 pm, Aristotle Pagaltzis wrote:
> * Yitzchak Scott-Thoennes <sthoenna@efn.org> [2008-07-29 21:00]:
>> The "correct" answer would presumably be:
>>
>> $words += () = split ' ', $_, 0;
>
> That doesn't even need the `() =` to work. But the point was to
> rely on `split`s default arguments.

By "correct" answer, I meant the code the deprecation warning
wants you to write (assuming you didn't actually want @_ filled).
So $words += split ' ', $_, 0; is inadequate.



Thread Previous


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