Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Why are my hash keys undefined?

by dorko (Prior)
on Feb 08, 2016 at 19:55 UTC ( #1154670=note: print w/replies, xml ) Need Help??


in reply to Why are my hash keys undefined?

I'm a big fan of debugging by print statements. When I'm using print statements to see what's in a variable, I'll wrap the variable in some odd characters to see special characters that otherwise might not show up on the screen.

If you change this line:

print "name is $name\n";

to something like this:

print "name is |||$name|||\n";

you'll see tabs, spaces, newlines, etc. at the beginning and end of your variable you might not otherwise notice.

Cheers,

Brent

-- Yeah, I'm a Delt.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2020-10-28 01:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (259 votes). Check out past polls.

    Notices?