Hi.  Maybe if u gave a more high level description of what ur trying to do
we might be able to help u more. I think what ur going for is a find/replace
on a list of files?  If so, this is not the way to do it.

A generic find/replace would be like:

foreach $file (@files) {
        open FILE, "<", $file;
        my $text = join "", <FILE>;
        close FILE;
        $text =~ s/aaa/bbb/g;
        open OUT, ">", $file;
        print OUT $text;
        close OUT;
}

But beware, that kind of simplistic find/replace is not very robust.


At 09:14 AM 5/13/2009 +0900, Chang Min Jeon wrote:
>hello
>
>I trying to modify file using perl one line like below.
>
>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.
>




--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede malis"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to