Current location: Hot Scripts Forums » Programming Languages » Perl » Small problem for a pro, but for novice like me... argh!


Small problem for a pro, but for novice like me... argh!

Reply
  #1 (permalink)  
Old 11-19-03, 10:02 AM
ntek ntek is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Question Small problem for a pro, but for novice like me... argh!

I have very basic problem with this script I'm working on, and since I'm total novice when it comes to perl, well..

Basically problem is this: I have variable $footer, which contains page footer HTML - what I need to do, is replace word QUERY in this variable with content from variable $keywords.. how can this be done in perl?

ntek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-19-03, 01:21 PM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Hey ntek,

I think this will work for you:

Code:
my $footer = qq~This is my footer text.  Replacted text: QUERY~;
my $keywords = qq~These are my keywords~;
$footer =~ s/QUERY/$keywords/;
If not, post what code you have now and I'll see if I can help you out.

~Charlie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-19-03, 02:39 PM
ntek ntek is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Works like a charm!

Quote:
Originally Posted by Chas
Hey ntek,

I think this will work for you:

Code:
my $footer = qq~This is my footer text.  Replacted text: QUERY~;
my $keywords = qq~These are my keywords~;
$footer =~ s/QUERY/$keywords/;
If not, post what code you have now and I'll see if I can help you out.

~Charlie
Thanks Charlie, it works just as it should - I was close, but not close enough ... again, thanks a million!!!

ntek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 11-19-03, 02:45 PM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ntek
Thanks Charlie, it works just as it should - I was close, but not close enough ... again, thanks a million!!!

ntek
No worries, glad that worked for ya

~Charlie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with this script Ken ASP 1 10-22-03 11:05 AM
file download problem ukyankee Perl 6 10-04-03 11:39 PM
jpGraph axis labeling problem Squeezer PHP 2 08-20-03 08:53 AM
Hosting and small web desgin javadude2003 General Advertisements 0 08-06-03 08:42 PM


All times are GMT -5. The time now is 09:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.