New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
push doesn't work on blessed references #11498
Comments
From @ikegamiCreated by @ikegami$ perl -wE'$_ = bless([]); push $_, "a";' It appears that when the check was added to C<keys>, C<values> and C<each>, - Eric Perl Info
|
From @ikegamiOn Tue, Jul 12, 2011 at 1:52 PM, Eric Brine <perlbug-followup@perl.org>wrote:
Just to be clear, the bug is that C<push> works on some arrays but not |
From @xdgOn Tue, Jul 12, 2011 at 2:12 PM, Eric Brine <ikegami@adaelis.com> wrote:
In RT #80626, the final decision was the automatic dereferencing The documentation should be amended to reflect this limitation. -- David |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Tue, Jul 12, 2011 at 2:28 PM, David Golden <xdaveg@gmail.com> wrote:
I thought we were trying to get rid of the bugs resulting from choice of |
From @xdgOn Tue, Jul 12, 2011 at 2:43 PM, Eric Brine <ikegami@adaelis.com> wrote:
One argument is that objects are opaque and perl should not go around It could be made to work with array-only functions (push/pop/etc.) but David |
From @sciuriusDavid Golden <xdaveg@gmail.com> writes:
Okay, but then: $ perl -wlE 'my $a = bless[]; push $a, 1' There's no such thing as an "unblessed ARRAY reference". It's either an -- Johan |
From @jbenjoreOn Tue, Jul 12, 2011 at 12:19 PM, Johan Vromans <jvromans@squirrel.nl> wrote:
That would be an inaccurate and misleading error message since the Josh |
From @sciuriusJoshua ben Jore <twists@gmail.com> writes:
Au contraire. If the statement is that objects are opaque, then the -- Johan |
From @janduboisOn Tue, 12 Jul 2011, Johan Vromans wrote:
While it does indeed become an object, that doesn't mean it ceases to push @$self, $whatever; So it isn't unreasonable to expect this to work as well: push $self, $whatever; Claiming that the later doesn't work because $self is not an array Cheers, |
From @ikegamiOn Tue, Jul 12, 2011 at 2:46 PM, David Golden <xdaveg@gmail.com> wrote:
First, it's not Perl doing the "messing", it's the caller, and it may very sub enqueue { Second, the point of forbidding this was for prevent confusion with objects It could be made to work with array-only functions (push/pop/etc.) but
The bug report is just for the former.
It removes one inconsistency but adds two more: - C<push $a, $_;> is not equivalent to C<push @$a, $_;> - C<push> works with some arrays "views" (magic) but not always with - Eric |
From @cpansproutThis ticket can be closed (and I am closing it), because the auto-deref feature to which it pertains was removed in 5.24. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#94654 (status was 'rejected')
Searchable as RT94654$
The text was updated successfully, but these errors were encountered: