William Olbrys wrote: > > I've started writing a simple perl script for a web site so I can update > it more quickly, but as I have a bit of a problem. > > Here is what I have: > > #!c:/Perl/bin/perl
You should enable warnings and strictures when developing your program. use warnings; use strict; > print "Content-type: text/html\n\n"; > $game = open (TEXT, "../htdocs/gameplow/game"); > $index = open (TEXT, "../htdocs/gameplow/index"); open() returns 'true' if the file was opened or 'false' if the file was not opened. You should use the return from open() to determine if the file opened correctly and do something appropriate if it did not. perldoc perlopentut perldoc -f open > $index =~ s/inpoint/$game/; s/// is trying to modify the contents of $index which will NOT contain the string 'inpoint'. > print $barf; > while ($index = <TEXT>) { > foreach $line($index){ foreach is used to iterate over arrays so it is not doing anything useful here. > print $line > } > } > close(TEXT); > > The problem is my search and replace does not work. I'm new to perl and > I find the perlre syntax very confusing. I simply want to replace one > word(a string) with a much bigger string! How are files accessed > differently than regular strings? I don't receive an error though. It > just doesn't replace the string... any help would be appreciated. perldoc -q "How do I change one line in a file" John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]