Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Can't use string

by rir (Vicar)
on Jan 31, 2008 at 22:00 UTC ( [id://665459]=note: print w/replies, xml ) Need Help??


in reply to Can't use string

use diagnostics can be helpful when diagnostic messages seem cryptic.

Be well,
rir

Replies are listed 'Best First'.
Re^2: Can't use string
by ikegami (Patriarch) on Feb 01, 2008 at 11:56 UTC

    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://665459]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found