in reply to Re: Can't use string
in thread Can't use string

I didn't know it worked for strict errors (or any other errors), so I tried it out. Turns out the diagnostic is even more cryptic than the original message, and misleading in mentioning references in what it usually a need to use a hash or array.

>perl -e"use diagnostics; use strict; print ${'x'}" Can't use string ("x") as a SCALAR ref while "strict refs" in use at - +e line 1 (#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 ("x") as a SCALAR ref while "strict refs" in +use at -e line 1. at -e line 1