in reply to Re: substitutions with unknown data (\b is \w not \s)
in thread substitutions with unknown data

Thanks for that code. I inserted it but I'm still having the same problem. I'll keep using it though since it's definitely better than what I was using.

I insterted a little test to do a printout of the faces to make sure we are using the right data.

I added

my ($username, $message, $date, $ip) = split(/<!!>/, $line); while ($sth->fetch) { $message =~ s|(?<!\S)\Q$face\E(?!\S)| <img src="$location" alt=" +$name"> |gi; print "$face<br>"; }
And the output was
*Crying* :) :( :P :O *hug* *flower* ;) *evil* *love* *yawn* 0<- albie *thumb* *angel* *cool* pix action test test: oh pix: emoticon :) test pix: emoticon :) test test: *hug* test: *hug* test: *hug* test: *hug* test: test :) here *hug* test test: test :) here *hug* test
So the $face data IS right but it's still not doing any of the s/// in the data. Any other suggesitons?

Thanks.



"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Replies are listed 'Best First'.
Re^3: substitutions with unknown data (\b is \w not \s)
by tye (Sage) on Mar 28, 2005 at 21:14 UTC

    This wouldn't show if you had spaces in your "face" strings, for example.

    For a situation like this, I'd probably just use "perl -d", set a break point at the loop and use "x $message" and "x $face" a couple of times.

    But you can also use something like Data::Dumper to get some more precise information about your data.

    - tye