in reply to Append problem!!PLS HELP!

Consider using File::Spec::Functions for operations on file names:
$ cat 632370.pl use strict; use warnings; use File::Spec::Functions; my $root = File::Spec->rootdir(); my $home = catfile( $root, qw ( t3file3 datools tools MTP ) ); my $logfile = catfile ( $home, q{logappend.txt} ); print $home; print $logfile; __END__
# Linux $ perl -l 632370.pl /t3file3/datools/tools/MTP /t3file3/datools/tools/MTP/logappend.txt
# Win32 C:\src\perl\perlmonks\632370>perl -l 632370.pl \t3file3\datools\tools\MTP \t3file3\datools\tools\MTP\logappend.txt
--
Andreas

Replies are listed 'Best First'.
Re^2: Append problem!!PLS HELP!
by MelaOS (Beadle) on Aug 15, 2007 at 04:12 UTC
    hi fellow monks, thanks for the prompt reply. Yes actually this is running on an UNIX env. And this script is actually being called on top of another script.
    One funny thing i've noticed is that the script should be running prior to the copy to another directory and also before it's being printed out.
    But what i'm seeing is that the softcopy doesn't have this information appended and the hardcopy does.
    Is the problem really from my script or from the part that runs below it?
    # Moved earlier to accomodate changes into the test summaries #-------------------------------eMarginality Tool extract------------- +------------------------ if ($RUNMODE eq "P" && $PRODUCT =~ /7ALGMV|7KEDMV|7ALGRV|7KEDRV|7RAYT +V/ ) { if(-e '/prod/datools/tools/MTP/emt_extract.pl'){ system "perl /prod/datools/tools/MTP/emt_extract.pl &"; } } unless(-e "$HOME/sbl/orig_sum_dir/$PRODUCT"){ system "mkdir $HOME/sbl/orig_sum_dir/$PRODUCT"; system "chmod 777 $HOME/sbl/orig_sum_dir/$PRODUCT"; } system "cp /tmp/t4sum $HOME/sbl/orig_sum_dir/$PRODUCT/${LOTNO}_${LOC}_ +${TYPE_NUM}${TYPE_LETT}"; unless(-e "$HOME/sbl/printed_sum_dir/$PRODUCT"){ system "mkdir $HOME/sbl/printed_sum_dir/$PRODUCT"; system "chmod 777 $HOME/sbl/printed_sum_dir/$PRODUCT"; } system "cp /tmp/foo $HOME/sbl/printed_sum_dir/$PRODUCT/foo${LOTNO}_${L +OC}_${TYPE_NUM}${TYPE_LETT}"; system "chmod 777 $HOME/sbl/sbl_sum_dir/$PRODUCT/${LOTNO}_${LOC}_$day$ +month${year}_${ww}"; if ($PRODUCT!~/^(8ARD|7KEDR)/) { system "lpr /tmp/foo &"; } else { system "/data/sbl/cchecklot ${LOTNO}_${LOC} $PRODUCT > /tmp/check_ +print"; system "sleep 4"; ## Will check for file exist and PCS triggered before adding the p +cs message if(-e '/tmp/check_print' && $PCS_T == 1 && $SBL_T == 1 && $NUTESTE +D >= 500 && $PCS_FOUND==1 && $TYPE_NUM==1){ &print_pcsmess; } system "lpr /tmp/check_print"; } system "chmod 777 $HOME/sbl/tmp/${LOTNO}_${LOC}_tmp1"; system "chmod 777 /tmp/t4sum"; system "chmod 777 /tmp/foo"; system "chmod 777 /tmp/check_print";