|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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/; } |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > y don't this piece of code work? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|