I need to write a script which looks at a file and replaces any curly brackets with normal brackets. so far I have:
use strict;
use warnings;
open(INFILE,"<rscore") || die "Couldn't open rscore for reading!\n";
open(OUTFILE,">rscore.new") || die "Couldn't open rscore.new for writing!\n";
while(<INFILE>){
$_ =~ s/{/(/gi; #g for every occurrence, i for case-insensitive
print OUTFILE $_;
}
close INFILE;
close OUTFILE;
rename("rscore.new","rscore") || die "Couldn't rename the new file!\n";
and getting the following error:
syntax error near line 10 near insensitive print.
This is probably something stupid. Also if there is a more efficient way of doing this (which i’m sure there is) i’d be open to suggestions.
This is a perl one-liner.