I want to replace 3 instances of file path in a directory by using perl oneliner. This is the command which i gave and worked well.
perl -e 's/\/usr\/bin\/perl/\/test\/test\/test/g;s/\/ggg\/ggg\/www/\/z
+zz\/zzz\/zzz/g;s/\/jjj\/jjj\/jjj/\/aaa\/aaa\/aaa/g;' -pi *.pl
But when i include this oneliner in a separate file called script.pl i am getting compilations errors here is how i have given;
#!/usr/local/bin/perl
use strict;
use warnings;
perl -e 's/\/usr\/bin\/perl/\/test\/test\/test/g;s/\/ggg\/ggg\/www/\/z
+zz\/zzz\/zzz/g;s/\/jjj\/jjj\/jjj/\/aaa\/aaa\/aaa/g;' -pi *.pl
print "Done";
The following error occurred for me when i compile this.
syntax error at script.pl line 8, near "perl -e "
script.pl had compilation errors
Can anyone tell me where i am wrong? Thanks monks for your valuable suggestion.