1. in the array Method 1 for (my $x = 0; $x <= $#privates; $x++) { $privates[$x] =~ s/^(.+)$/"$1"/ }
Method 2 for (0..$#privates) { my $temp = shift(@privates); $temp = '"'.$temp.'"'; push (@privates, $temp) } I believe there should be a simpiler way, anybody in list can tell ? 2. in the unlink loop [...] print "\"$_\""; [...] Rgds, Connie ----- Original Message ----- From: "Javeed SAR" <[EMAIL PROTECTED]> To: "Connie Chan" <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 7:15 PM Subject: RE: del files > Ok, can u tell me this > > Hi All, > > my @privates =`cleartool lsprivate -tag jav_test -other -invob \\train`; > print @privates; > > > I get this output when I execute the above script: > > M:\jav_test\train\chet chet.mkelem > > > I want put this output in double quotes,how to do that in perl?? Like > this > > "M:\jav_test\train\chet chet.mkelem" > > > > -----Original Message----- > From: Connie Chan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 2:28 PM > To: Javeed SAR > Cc: [EMAIL PROTECTED] > Subject: Re: del files > > > > > What about if there r space in file names? > > There is no problem for unlink to handle filename with spaceS. > The issue is on how you get the file list to the array. > > Rgds, > Connie > > > > > > > > > > > -----Original Message----- > > From: Connie Chan [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, July 25, 2002 2:07 PM > > To: Javeed SAR; [EMAIL PROTECTED] > > Subject: Re: del files > > > > for (@privates) > > { chomp; > > print "Attemp to del $_\n"; > > unlink ($_) ? > > {print "$_ unable to del" } : > > {print "$_ deleted" }; > > } > > > > I didn't ever tried unlink @array like method, > > perhaps the problem is there. > > > > and you got 0 delete is the "fail signal" send > > back from the unlink action. you will got 1 deleted > > if the unlink is success. > > > > Rgds, > > Connie > > > > > > ----- Original Message ----- > > From: "Javeed SAR" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, July 25, 2002 2:46 PM > > Subject: del files > > > > > > > > > > > > > > > > I want to delete files. > > > > > > I am not able to delete , what is the wrong thing I am doing here. > > > I am able to see the file in @privates > > > > > > > > > I am getting following output: > > > > > > > > > 0 deleted > > > Attempting to delete M:\jav_test\train\k k k.mkelem.mkelem > > > > > > > > > > > > #!c:\perl\bin\perl > > > @privates =`cleartool lsprivate -tag jav_test -other`; > > > #print "@privates"; > > > #print "Enter a pattern:"; > > > #my $pattern =<>; > > > #chomp $pattern; > > > foreach (@privates) > > > { > > > print "\nAttempting to delete $_\n"; > > > $delo=unlink @private; > > > print "\n $delo deleted"; > > > } > > > > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]