hi, while working on a script to automize Clearcase labelling I came across a weird problem. while running this code:
#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!";} }
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; print "cleartool rmtype -rmall lbtype:LABEL";
This returns the correct output. At this point I was lost. Does someone know what causes this problem and how to solve it?

In reply to Printing - on windows by jevaly

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.