You're right, sorry, but perhaps the reason why it is returning 0 is because
a) he's attempting to unlink @private instead of @privates (or that could just be an email typo) b) he's attempting to unlink @privates each time he cycles through an element of @privates, so the only time he would get a non-zero result is the first time through the loop. -----Original Message----- From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 12:41 AM To: Timothy Johnson Cc: 'Javeed SAR '; '[EMAIL PROTECTED] ' Subject: RE: del files On Thu, 25 Jul 2002, Timothy Johnson wrote: > > Your script states "Attempting to delete $_", but when you actually go to > delete it, you have "unlink @private", which translates to "unlink a file > whose name is the number of elements in @private. No, unlink takes a list of files to delete and returns the number of files successfully deleted. His statement is just fine. Javeed, Not sure how the output of cleartool lsprivate looks like, the reason for unlink returning a 0 maybe the presence of newlines in the output. If so you will have to chomp them off. I think you want to > change that line to "unlink $_", followed by "$_ deleted". > > -----Original Message----- > From: Javeed SAR > To: [EMAIL PROTECTED] > Sent: 7/24/02 11: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]