SleepingMonk has asked for the wisdom of the Perl Monks concerning the following question:

hi there fellow monks, I keep getting the same error message:

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

adc_object.pm line 133 (#1)

F) Only hard references are allowed by "strict refs". Symbolic

references are disallowed. See perlref.

Uncaught exception from user code:

Can't use string ("adc") as a HASH ref while "strict refs" in use at adc _object.pm line 133.

adc::getConfigurationByte('adc') called at adc_object.pm line 56

adc::setAdcUp('adc') called at demoApp.pl line 17

any help would be nice

Replies are listed 'Best First'.
Re: strict refs-----the on going saga
by zby (Vicar) on Jul 23, 2003 at 11:11 UTC
    Please post your code. Now I can only gues: perhaps you use a variable whose value is the 'abc' string as if it contained a hashref.
    $ perl -e 'use strict; my $a = "abc"; $a->{"aaa"} = "a"' Can't use string ("abc") as a HASH ref while "strict refs" in use at - +e line 1.
    Here the variable $a contains the string, but in $a->{"aaa"} = "a" I used it as if it contained a hash reference.
      cheers for the explanation, i understand it now, and have subsequently got rid of the error, :D, cheers,

      SleepingMonk
Re: strict refs-----the on going saga
by Aristotle (Chancellor) on Jul 23, 2003 at 11:42 UTC
    The problem is at the end of line 209.

    Makeshifts last the longest.