CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
emoticons

 



etheracide
journeyman

Jul 5, 2001, 4:36 PM

Post #1 of 2 (512 views)
emoticons Can't Post

I have been searching endlessly for an example code where you call images to replace particular text. Such as ( ;-) :-) etc...) I am trying to add the automatic emoticon feature to my guestbook, but everything I try just doesn't work. Anyone have any ideas to atleast head me off in the right direction? Thanks.



Pro_4
User

Jul 5, 2001, 5:28 PM

Post #2 of 2 (510 views)
Re: emoticons [In reply to] Can't Post

This is what i would do (lets say :) is smile.gif ):

Code
#msg contains the guestbook post or whatever 
$msg =~ s/:\)/<img src="smile.gif">/g;

That should work but i am not sure, give it a spin (if you know a lot about regex you will easily spot any mistake i made in that because that is something i have barely touched on so far). Anyways that is basically what it should look like.

@letters = ('A'..'Z', 'a'..'z', '1'..'5', '_');
@i = ( '15', '43', '40');
print @letters [ @i, -1, 55];

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives