@rem = ' PERL for Windows NT - ccperl must be in search path @echo off ccperl %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl @rem '; use Net::SMTP; my $smtp; my @typeCmdOut; my $type; my @cmdOut; my $cmd; $CLEARCASE_COMMENT=$ENV{CLEARCASE_COMMENT}; $ELEM_NAME=$ENV{CLEARCASE_PN}; @typeCmdOut = "cleartool describe -fmt \"\%[type]p\" $ELEM_NAME"; chomp ( @typeCmdOut ); $type = @typeCmdOut[0]; #if ($ELEM_NAME=~m/txt/) if ( $type =~ m/text_file/ ) { # create command string # change command string \ to / globally # run the command, capturing the results in an array # $cmd = "cleartool diff -pred -serial " . $ELEM_NAME; $cmd = "cleartool diff -pred -serial $ELEM_NAME"; # $cmd =~ s/\\/\//g; @cmdOut = `$cmd`; } my @MSG = ("Trigger activation mail notification for controlled action on VOB ($ENV{'CLEARCASE_VOB_PN'}): User: $ENV{'CLEARCASE_USER'} Operation: $ENV{'CLEARCASE_OP_KIND'} Element: $ENV{'CLEARCASE_PN'} Version: $ENV{'CLEARCASE_ID_STR'} Comment: $ENV{'CLEARCASE_COMMENT'}\n"); $smtp = Net::SMTP->new('mail.xxx.com'); $smtp->mail('xxx'); $smtp->to('xxx'); $smtp->data(); $smtp->datasend("TO: xx\xx\n"); $smtp->datasend("Subject: Diffrences\n"); #foreach (@cmdOut) #{ # $smtp->datasend($_); #} $smtp->datasend(@MSG); $smtp->datasend($cmd); $smtp->dataend(); $smtp->quit; __END__ :endofperl