Javeed Sar wrote: > > 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"; > }
This should do what you want: #!c:\perl\bin\perl -w use strict; my @privates = `cleartool lsprivate -tag jav_test -other`; chomp @privates; for my $private ( @privates ) { print "\nAttempting to delete $private\n"; unlink $private or warn "Cannot delete $private: $!"; } __END__ John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]