in reply to File content written by script and a called script

You could try to seek the end of file after the second script has been called.
Perl 6 - links to (nearly) everything that is Perl 6.
  • Comment on Re: File content written by script and a called script

Replies are listed 'Best First'.
Re^2: File content written by script and a called script
by chilukuri_perl (Novice) on Sep 23, 2009 at 11:21 UTC
    Adding seek doesn't solve it.
    #!/usr/local/bin/perl $logFl = "xyz.log"; open (FIRSTFH, "> $logFl") || die "couldn't open file...$!\n"; print FIRSTFH "This is from first script\n"; system("script2.pl $logFl"); seek (FIRSTFH, 0, SEEK_END); print FIRSTFH "This is second print in first script\n"; ~
    Now output is
    $ cat xyz.log
    This is second print in first script
    m second script

    Note that some part of print message in second script is not printed
      Adding seek in second script solved it. Thanks...