I would like to replace string 1 with string 2 in file3.dat, here is
what I
did:
#!/usr/bin/perl
@inputfile= ("string1"); # need to have an arrary later
@outputfile=("string2");
@attfile=("file3.dat");
$mytempfile=$inputfile[0];
$youtempfile=$outputfile[0];
$hisfile=$attfile[0];
perl -pi -e 's/$mytempfile/$youtempfile/' $hisfile;
The program reports an error:
Scalar found where operator expected at test line 10 near 's/
$mytempfile/$
youtempfile/' $hisfile
missing operator before $hisfile?)
Syntax error at test line 10, near "pi -e"
I am new to perl, please help!!!
thanks.