Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
General
:
Perl Programming
:
Changing :) to an image
Previous Thread
Next Thread
Print Thread
View Threaded
Nov 22, 1999, 2:42 PM
Bmxer
Veteran
(1311 posts)
Nov 22, 1999, 2:42 PM
Post #1 of 4
Views: 3073
Shortcut
Changing :) to an image
I'm changing around a guestbook script to make certain emoticons be images, but i get errors,
why doesn't this work$in{'Comment'} =~ s/\
/<img src="smile.gif">/g;
Nov 23, 1999, 2:57 AM
Chris071371
User
(195 posts)
Nov 23, 1999, 2:57 AM
Post #2 of 4
Views: 2932
Shortcut
Re: Changing :) to an image
In reply to
One reason may be that you need to call the full URL to the image, as you may not store images in the CGI directory.
------------------
WFMY-TV Webmaster
Nov 23, 1999, 5:06 AM
GClemmons
User
/ Moderator
(314 posts)
Nov 23, 1999, 5:06 AM
Post #3 of 4
Views: 2923
Shortcut
Re: Changing :) to an image
In reply to
Perl's metacharacter list for patern matching is as follows:
\ | ( ) [ { ^ $ * + ? .
You need to escape these whenever you have them in a regex.
Try:
$in{'Comment'} =~ s/:\)/<img src="smile\.gif">/g;
-- Gordon --
------------------
$blah='82:84:70:77';
print chr($_) foreach (split/:/,$blah);
Nov 23, 1999, 5:02 PM
Bmxer
Veteran
(1311 posts)
Nov 23, 1999, 5:02 PM
Post #4 of 4
Views: 2925
Shortcut
Re: Changing :) to an image
In reply to
Thanks GClemmons, that helped out alot.
Previous Thread
Next Thread
Print Thread
View Threaded