Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 6th, 2001, 11:06 AM
robahall robahall is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 6 robahall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 58 m 35 sec
Reputation Power: 0
y don't this piece of code work?

$filetoopen = "ikondir" . "data/bad.cgi";
open (FILE, ">$filetoopen");
@badwords = <FILE>;
close (FILE);

foreach $line (@badwords) {

($goodword, $badword) = split (/\|/,$line);
$inpost =~ s/$goodword/$badword/;
}

Reply With Quote
  #2  
Old September 6th, 2001, 11:27 AM
bumperbox bumperbox is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Tauranga, NZ
Posts: 349 bumperbox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
try this in case, its having trouble opening the file

open (FILE, ">$filetoopen") or die ("Error opening $filetoopen ", $!);

the rest of the script looks ok

Reply With Quote
  #3  
Old September 10th, 2001, 01:07 PM
Marky_Mark Marky_Mark is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: On a screen near you
Posts: 498 Marky_Mark User rank is Private First Class (20 - 50 Reputation Level)Marky_Mark User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Smile

What might be causing a problem is this line


$filetoopen = "ikondir" . "data/bad.cgi";


What your doing is joining one directory onto another, at the moment youve got


$filetoopen = "ikondirdata/bad.cgi";

The correct file path should be "ikondir/data/bad.cgi"

try adding a forward slash after ikondir
like so

$filetoopen = "ikondir/" . "data/bad.cgi";

Hope its of some help


Marky_Mark

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > y don't this piece of code work?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT