the print statement #121# returns "cleartool rmtype ūrmall lbtype:LABEL" instead of "cleartool rmtype -rmall lbtype:LABEL" this of course results in an error with the system call. I tried to use backticks, but the same problem occurs. When skipping this option the program gives the correct result. To test the nature of this problem I made a quick program with only the print statement:#perl -w use strict; my $view; my $labelold; my $labelnew; my $ab; my $ba; my $element; my $rc; my $path; my $path2; my $input; my $comment; my @VOBs; my @lijst; #system("cls"); print "\nThis script will apply a label to all objects of another labe +l."; print "\nplease enter the name of the active view (e.g.: u12345-1): "; chomp ($view = <STDIN>); while(){ print "\nEnter the name of a VOB you want to access (e.g.: PowerCe +nter, PowerCenter_s), press Enter when finished:"; chomp ($ab = <STDIN>); unless($ab){last;} push(@VOBs, $ab); } print "\nGive the name of the old label (e.g.: DXOPRJ0-1.0.0): "; chomp($labelold = <STDIN>); print "\nGive the name of the new label (e.g.: DXOPRJ0-1.0.1): "; chomp($labelnew = <STDIN>); print "\n Give the comment for the new label: "; chomp($comment =<STDIN>); $path = "u:\\$view\\"; chdir($path); foreach $element(@VOBs){ $path2 = $path . "\\$element"; chdir($path2); $ab = "cleartool mklbtype -c \"$comment\" $labelnew"; $rc = system "$ab"; while($rc!=0){ $rc = 0; print "\nlabel $labelnew already existed! Do you want to repla +ce it(y\/n)?"; chomp($input = <STDIN>); unless($input eq 'n'||$input eq 'no'||$input eq 'N'||$input eq + 'NO'){ $ba = "cleartool rmtype rmall lbtype:$labelnew"; #121#print "$ba"; $rc = system("$ba"); if($rc!=0){print "\ndeletion of CC label failed!";} $rc = system "$ab"; } } chdir($path); $ab = "cleartool find $element -version \"lbtype($labelold)\" -exe +c \"cleartool mklabel -replace $labelnew %CLEARCASE_XPN%\""; $rc = system "$ab"; if($rc!=0){ die "\nan error occured..."; } else{ print "\nlabelling $element succesfull!";} }
This returns the correct output. At this point I was lost. Does someone know what causes this problem and how to solve it?#perl -w use strict; print "cleartool rmtype -rmall lbtype:LABEL";
In reply to Printing - on windows by jevaly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |