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
From:
James E Keenan via RT
Date:
January 27, 2012 19:50
Subject:
[perl #27392] 5.8.2 cores or loops using hashref as subscript
Message ID:
rt-3.6.HEAD-14510-1327722624-1661.27392-15-0@perl.org
I reviewed this older ticket tonight.  Trimming the last post:

#####
On Fri Mar 05 04:19:24 2004, keni@aol.net 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 27393.pl 
Useless use of hash element in void context at 27393.pl line 10.
X: 1
X: HASH(0x1804180)
Use of reference "HASH(0x1804180)" as array index at 27393.pl line 10.
Use of uninitialized value $_ in concatenation (.) or string at 27393.pl
line 9.
X: 
Use of uninitialized value $_ in array element at 27393.pl line 10.
Can't use string ("1") as a HASH ref while "strict refs" in use at
27393.pl 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
https://rt.perl.org:443/rt3/Ticket/Display.html?id=27392

Thread Previous | Thread Next


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