develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133109] push on scalar forbidden: why?

Thread Previous
Dan Book via RT
April 14, 2018 00:52
[perl #133109] push on scalar forbidden: why?
Message ID:
On Fri, 13 Apr 2018 17:32:21 -0700, wrote:
> And in cases
> like:
> my %a = (0=>undef);
> push @{$a{0}}, 1;
> say STDERR dump(%a);
> it would make code much more readable.
> If Linda's scheme can be shown to be safe and unambiguous on all cases of
> pop, push, shift, unshift then I would like to see this capability returned
> to Perl because it is more concise.

Just for reference, this can also be written as push $a{0}->@* on Perl 5.24+ (or slightly earlier with the experimental feature). That might be more palatable to some when it comes to long dereference chains.

via perlbug:  queue: perl5 status: open

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About