Hi.

Chang Min Jeon wrote:
>
> I trying to modify file using perl one line like below.
>
> my $cmd = "perl -pi -e's/aaa/bbb/' ";
I think that there should be a space between the -e and the regular 
expression
my $cmd = "perl -pi -e 's/aaa/bbb/' ";

If you're in the Windows world, you might also want to try using double 
quotes around the regular expression
my $cmd = 'perl -pi -e "s/aaa/bbb/" ';
>
> open(MAKEFILES, '<', $ARGV[0]) or die "file open error";
> my @filelist = <MAKEFILES>;
> foreach my $file (@filelist) {
>     chomp($file);
>     my $command =  $cmd.$file;
>     print $command,"\n";
>     !system($command) or die "shell command not work";
> }
> close(MAKEFILES);
>
> but system function does not work.
>
> It print
>
> ./Windowset/Common/Makefile.gmk
> perl -pi -e's/-+g -+dwarf2//' ./Windowset/Common/Makefile.gmk
> : No such file or directory.mmon/Makefile.gmk
> ./Windowset/Special/Makefile.gmk
> perl -pi -e's/-+g -+dwarf2//' ./Windowset/Special/Makefile.gmk
> : No such file or directory.cial/Makefile.gmk
>
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to