Hello,
My perl-cgi program copies by number one-liners (using file I/O) from a list in a file that is in my html directory which can be displayed as a web page. New one-line strings are added or old removed from the list dynamically with buttons on a separate web page. Each chosen one-liner needs to be modified with
regexp in order to be passed to a javascript function for display in a text area on this web page. For example, quotes must be removed or re-escaped (
$sqlQuery =~ s/\'/\\'/g;).
A character found at the end of some of the one-liners as "^M" must also be removed. It appears only in the unix(html) file in blue, contrasting the adjacent white text. I have no idea of it's origin or meaning. Using the chop function (or $string =~ s/.$//g;) works where this "^M" tail is present, but it's indiscriminate and $string =~ s/\\^M$//g; does nothing (with or without escaping "^"). What's the nature of this blue "^M" character and how do I select it out from the string?
My thanks for any answers.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.