Sorry, in making this sample I didn't take into account that I am reading my data from 
other files and would need to delimit the \$ in a string enclosed within the file, but 
that is not my problem...


This is:

I commented all pattern matches out and got this string for my body text after parsing 
data:

<p>In North Carolina, the maximum payout from video poker machines is $10 in 
merchandise blah blah etc... </body>


Then, I uncommented ONLY this pattern out ->
$booty =~ s/\$/&#36;/g;

and got this string after parsing data: 
<p>In North Carolina, the maximum payout from video poker machines is &</body>

The string is getting truncated at the $.

I'm stumped.



Robert wrote:

In your original string, Perl is trying to interpolate the original $ - It
thinks it's a variable.

So, either escape it :-

$crud = "I need to make \$10,000 a month to support my crack habit!";

Or use single quotes :-

$crud = 'I need to make $10,000 a month to support my crack habit!';

Some reg-ex parsers will want the & escaped as well, but Perl seems ok in
this case.

Robert.
-- 
Thank you
--------------------------------------
Charles Harvey
[EMAIL PROTECTED]
http://www.thesunnews.com
http://www.myrtlebeachonline.com
Work (843) 444-1773
Cell 843-222-0974
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
None are so old as those who have outlived enthusiasm. 
--Henry David Thoreau 

Reply via email to