This substitution map that is more varied than JavaFan's quick-and-dirty solution, so by looking at the output you have a better idea what the original space was.
use charnames ':full'; %spaces = ( "\N{CHARACTER TABULATION}" => "\N{SYMBOL FOR HORIZONTAL TABULA +TION}", "\N{LINE FEED (LF)}" => "\N{SYMBOL FOR LINE FEED}", "\N{LINE TABULATION}" => "\N{SYMBOL FOR VERTICAL TABULATION}", "\N{FORM FEED (FF)}" => "\N{SYMBOL FOR FORM FEED}", "\N{CARRIAGE RETURN (CR)}" => "\N{SYMBOL FOR CARRIAGE RETURN}" +, "\N{SPACE}" => "\N{SYMBOL FOR SPACE}", "\N{NEXT LINE (NEL)}" => "\N{DOWNWARDS ARROW WITH CORNER LEFTW +ARDS}", "\N{NO-BREAK SPACE}" => "\N{MIDDLE DOT}", "\N{OGHAM SPACE MARK}" => "\N{HYPHEN-MINUS}", "\N{MONGOLIAN VOWEL SEPARATOR}" => "\N{HYPHEN-MINUS}", "\N{EN QUAD}" => "\N{EN DASH}", "\N{EM QUAD}" => "\N{EM DASH}", "\N{EN SPACE}" => "\N{EN DASH}", "\N{EM SPACE}" => "\N{EM DASH}", "\N{THREE-PER-EM SPACE}" => "\N{HYPHEN-MINUS}", "\N{FOUR-PER-EM SPACE}" => "\N{HYPHEN-MINUS}", "\N{SIX-PER-EM SPACE}" => "\N{HYPHEN-MINUS}", "\N{FIGURE SPACE}" => "\N{FIGURE DASH}", "\N{PUNCTUATION SPACE}" => "\N{MIDDLE DOT}", "\N{THIN SPACE}" => "\N{MIDDLE DOT}", "\N{HAIR SPACE}" => "\N{MIDDLE DOT}", "\N{LINE SEPARATOR}" => "\N{DOWNWARDS ARROW WITH CORNER LEFTWA +RDS}", "\N{PARAGRAPH SEPARATOR}" => "\N{PILCROW SIGN}", "\N{NARROW NO-BREAK SPACE}" => "\N{MIDDLE DOT}", "\N{MEDIUM MATHEMATICAL SPACE}" => "\N{MIDDLE DOT}", "\N{IDEOGRAPHIC SPACE}" => "\N{IDEOGRAPHIC NUMBER ZERO}", );
For accuracy, however, nothing beats the uniquote filter. The result does not look like in a text editor anymore, but solves the problem completely: all invisible characters (not only spaces) are quoted/made visible.

In reply to Re: Perl module to show whitespaces? by Anonymous Monk
in thread Perl module to show whitespaces? by ndinsmore

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.