Hi again,
Now it looks even weirder :
my $retValType=$retVal->{'type'};
if ($retValType =~ m/^struct/)
and I get the same error (Can't use string ("enum eAsonTrail") as a HASH ref
...) on the second line , and not on the first one !
Yossi
From: [email protected] [mailto:[email protected]] On Behalf Of
Yossi Itzkovich
Sent: Monday, August 01, 2011 2:12 PM
To: Perl in Israel
Subject: [Israel.pm] Bug in Perl ? (or : what am I missing here ?)
Hi,
I have the following code in a script that parses C header files:
....
$retVal->{'type'} =~ /^struct/;
if ($retVal->{'type'} =~ /^struct/)
{
...
}
In one of the iterations I get this error:
Can't use string ("enum eAsonTrail") as a HASH ref while "strict refs" in use
at ./cpp2idl.pl line 701, <$fh> line 163.
Line 701 is the second one in the code above, and I added line 700 above only
to show that it passes OK. Also the ref(), Data::Dumper and and the debugger
show that this is indeed a ref to a hash with the key 'type'.
I am using perl 5.8.8 built for i86pc-solaris
Is it a bug in Perl, or in my head/eyes ?
Yossi
This e-mail message is intended for the recipient only and contains information
which is CONFIDENTIAL and which may be proprietary to ECI Telecom. If you have
received this transmission in error, please inform us by e-mail, phone or fax,
and then delete the original and all copies thereof.
This e-mail message is intended for the recipient only and contains information
which is CONFIDENTIAL and which may be proprietary to ECI Telecom. If you have
received this transmission in error, please inform us by e-mail, phone or fax,
and then delete the original and all copies thereof.
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl