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
pre-extending an array should fill it with undef #8363
Comments
From pcg@goof.comCreated by pcg@goof.comI am not sure this is actually a bug, I couldn't quite find hard There is a difference between pre-extending an array by assigning $#a and # perl -e '$#a = 1; map $_->{x}, @a' # perl -e '@a = (undef); map $_->{x}, @a' Now the question is wether they should behave the same (preferably like Perl Info
|
From @TimToadyOn Fri, Mar 10, 2006 at 08:53:09AM -0800, Marc Lehmann wrote: Mmm, it's kind of implied by the doc for exists(). : There is a difference between pre-extending an array by assigning $#a and Well, the intent of the design was that exists() should allow for Larry |
The RT System itself - Status changed from 'new' to 'open' |
From schmorp@schmorp.deOn Fri, Mar 10, 2006 at 05:42:33PM -0800, Larry Wall via RT <perlbug-followup@perl.org> wrote:
Hmm... "kind of", I agree. I wouldn't be able to deduce the behaviour for
Well, not to me, but I cna easily come up with useful cases, even if I never Now the question is why they shouldn't auto-vivify. But this is probably In any case, feel free to close this report, its not a big deal to me, I just -- |
From @nwc10On Sun, Mar 12, 2006 at 01:33:37AM +0100, Marc Lehmann wrote:
My gut feeling was that they should auto-vivify, so the example you provided $ perl -e '$#a = 1; map $_->{x}, @a' demonstrates a bug in the implementation. I think that these two should be $ perl -e '$#a = 3; $_ = 1 foreach @a' Nicholas Clark |
From schmorp@schmorp.deOn Mon, Mar 13, 2006 at 09:08:36AM -0800, Nicholas Clark via RT <perlbug-followup@perl.org> wrote:
Well, the documentation is, after all, not correct as it does say they
That is interesting. I would have supposed that map and foreach both work Yes, I'd say that this inconsistency is indeed a bug, regardless of how it -- |
p5p@spam.wizbit.be - Status changed from 'open' to 'stalled' |
Migrated from rt.perl.org#38703 (status was 'stalled')
Searchable as RT38703$
The text was updated successfully, but these errors were encountered: