HI, I am trying to write a script in Perl which will create a clearcase view (dynamic) and also set the config spec from a file. But when i run the script, it terminates just after creating the view and not proceeding with further commands (Probably because of a new shell). Can you please help me in fixing this. My code is mentioned below

#!/opt/trs/apps/bin/perl -w use strict; my $usr=`whoami`; print " User is $usr "; my $ct = '/usr/atria/bin/cleartool'; chomp($usr); #my $viewtag = $usr."-pal-rel"; my $viewtag="palmida-rel"; my $bl_name = $ARGV[0]; my $cs_file = "/tmp/$usr-cc-cs.txt"; print " the BL is $bl_name \n"; open (my $file, ">", "$cs_file") || die ("No Config Spec file"); #print MYFILE "element * CHECKEDOUT \nelement * /main/LATEST"; print $file "element * $bl_name \n"; close ($file); print $file; sub usage { print " USAGE: \n Please Run the script as shown below. \n perl /home +/venn/MyPerl/pal.pl <BL NAME> \n"; } #&usage(); print " $viewtag \n"; #system(sprintf("%s mkview -tag %s -stgloc viewstg_bheecc18; %s setvie +w %s", $ct, $viewtag, $ct, $viewtag)); #system ("$ct mkview -tag $viewtag -stgloc viewstg_bheecc18; $ct setvi +ew $viewtag; $ct catcs"); system ("$ct mkview -tag $viewtag -stgloc viewstg_bheecc18;"); system ("$ct setview $viewtag; $ct setcs $cs_file"); system ("$ct setview $viewtag; $ct catcs");
My Apologies if i am posting this in the wrong forum/section. Regards, Perl Noob !.. Venu

In reply to Execute multiple clearcase commands in Perl Script by Anonymous Monk

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.