Hi all, I'm new here and must confess my perl knowledge is very limited. I'm trying to use a perl script that will replace a line in an other html file on the same box. Problem is that there are brackets ( ) in the text that I want to replace and I can't find a way to get it to work. Here is my code:
my $filename = '/tmp/somefile.html'; my $find = "<option SELECTED>[ Current time range ]"; my $replace = '<option SELECTED> Current time'; { local @ARGV = ($filename); local $^I = '.bac'; while( <> ){ if( s/$find/$replace/ig ) { print; } else { print; } } }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |