Re: use system() function

2009-05-13 Thread Chris Wagner
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, "<",

Re: use system() function

2009-05-13 Thread Todd Beverly
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 wan

RE: use system() function

2009-05-13 Thread Brian Raven
From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of mohammed.must...@wipro.com Sent: 13 May 2009 06:30 To: jcm1...@gmail.com; Perl-Win32-Users@listserv.ActiveState.com Subject: RE: use system() function > Hi Chang Min Jeo

RE: use system() function

2009-05-13 Thread Brian Raven
From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Chang Min Jeon Sent: 13 May 2009 01:14 To: Perl-Win32-Users@listserv.ActiveState.com Subject: use system() function > hello > > I trying to modify file using perl one l

RE: use system() function

2009-05-13 Thread mohammed.mustafa
Hi, I have not tried below code, but I suggest you few more things here, 1) my $cmd = "perl -pi -e 's/aaa/bbb/g' ";# you are are missing g here. I doubht below command is working. my $command = $cmd.$file; ## is concatenation operator required here. Bit busy now meanwhile try aboove

Re: use system() function

2009-05-13 Thread Chang Min Jeon
Hi mustafa Thank you for your help. I changed following code but it still doesn't work. my $cmd = "perl -pi -e's/aaa/bbb/' "; open(MAKEFILES, '<', $ARGV[0]) or die "file open error"; my @filelist = ; foreach my $file (@filelist) { chomp($file); my $command = $cmd.$file; print $comm