Perl error

cbrandtbuffalo on 2004-09-03T17:01:44

One of the stranger Perl errors I've gotten:

Can't use string ("sredro_qereedoc_lavorppa_falsred") as a HASH ref while "strict refs" in use...

I can assure you that string was not in my program. Although after thinking for a bit, I think I know where it came from.


What to look for

samtregar on 2004-09-03T18:27:19

That error happens when you do:

my $ref = "some string";
$ref->{foo} = "bar";

So you need to figure out which hash-ref got set with that string instead of a reference to a hash.

-sam

Reverse

pijll on 2004-09-03T19:10:59

If that wierd string is not in your code, perhaps the strings "approval_code" and "req_orders" are?

Re:Reverse

cbrandtbuffalo on 2004-09-03T19:23:58

If I had a cigar, I'd give you one!

I was actually trying to be clever with:

my @tables = keys %{reverse %{$Ereq::page_params{$page}}};

Thought I could get the unique values that way, but mashing it all together caused problems.

Re:Reverse

link on 2004-09-03T20:16:15

How about :
my @values =
keys %{ { reverse %{ Ereq::page_params{$page} } } };

I think the problem is that your calling reverse in scalar context