Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: RFC: Basic debugging checklist

by JavaFan (Canon)
on Feb 19, 2009 at 00:06 UTC ( [id://744914]=note: print w/replies, xml ) Need Help??


in reply to RFC: Basic debugging checklist

Check for unprintable characters and identify them by their ASCII codes using ord
print ":$_:", ord($_), "\n" for (split //, $str)
That, IMO, makes it hard to spot unexpected unprintable characters because you turn ALL characters into numbers. I often do:
my $copy = $str; $str =~ s/([^\x20-\x7E])/sprintf '\x{%02x}', ord $1/eg; print $str, "\n";
which leaves all printable ASCII characters as is, and turns all other characters into hex escapes.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 23:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found