develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #27392] 5.8.2 cores or loops using hashref as subscript

Thread Previous | Thread Next
James E Keenan via RT
January 27, 2012 19:50
[perl #27392] 5.8.2 cores or loops using hashref as subscript
Message ID:
I reviewed this older ticket tonight.  Trimming the last post:

On Fri Mar 05 04:19:24 2004, wrote:
> I agree - my code was in error.  But I don't like being able to core
> an interpreter (and not get any indication of why).

So it appears the OP concedes he was attempting something he should not
have.  When I run the attached program -- which throws 'use strict' and
'use warnings' around the OP's code -- I get:

$ perl 
Useless use of hash element in void context at line 10.
X: 1
X: HASH(0x1804180)
Use of reference "HASH(0x1804180)" as array index at line 10.
Use of uninitialized value $_ in concatenation (.) or string at
line 9.
Use of uninitialized value $_ in array element at line 10.
Can't use string ("1") as a HASH ref while "strict refs" in use at line 10.

So I am amply warned of my bad behavior.  I recommend we close this ticket.

Thank you very much.
Jim Keenan

via perlbug:  queue: perl5 status: open

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