Now what you need to do is figure out how your situation differs. That means putting in print statements so you can see what's really going on every step of the way, and then examining the output for what wasn't what you expected it to be. Start by replacing your if-face-block with something likemy $message = 'one :-* smiley'; my ($face, $location, $name) = (':-*', 'here', 'smoochie'); $message =~ s/\Q$face\E/ <img src="$location" alt="$name"> /gi; print $message, "\n";
That way, you get a definite indication of what path things took and what your variables were. Something will probably jump out at you.if ($face) { if ($message =~ s/\Q$face\E/ <img src="$location" alt="$name"> + /gi) { print "Substituted for [$face] in [$message]\n"; } else { print "[$face] was not found in [$message]\n"; } } else { print "$face was not true!\n"; }
In reply to Re^3: s/// with asterisks and other chars
by Roy Johnson
in thread s/// with asterisks and other chars
by froglover
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |