in reply to <write format> records order error

You have different filehandles, each with a buffer. Either make all the filehandles unbuffered (select them, then set $| = 1;), or just use a single filehandle, and use the $~ variable to switch formats.

Replies are listed 'Best First'.
Re^2: <write format> records order error
by Anonymous Monk on Jan 25, 2010 at 23:01 UTC
    Tx, JavaFan for lead. I tried to use var in filehandle, but alwayse has an error: Can't use string ("OUT_HEADER") as a symbol ref while "strict refs" in use: what I'm missing now?
    my $OUT_WWW="test"; open ('$OUT_WWW', '>>spool.dat'); #======================================================= format OUT_HEADER= @<<<==== f0rmat HEADER HEADER HEADER Page : @<<< $cc, $cc . format OUT_DETL= @<<<======== f0ramt detail line ============= $cc . #======================================================== $OUT_WWW="OUT_HEADER"; write "$OUT_WWW"; $cc++;
      '$OUT_WWW' is a string starting with a dollar sign. There's no interpolation.

      But even if there were, I don't know what you are trying to do here.

Re^2: <write format> records order error
by Anonymous Monk on Jan 25, 2010 at 22:57 UTC
    Tx, JavaFan for lead. I tried to use var in filehandle, but alwayse has an error: Can't use string ("OUT_LOG") as a symbol ref while "strict refs" in use: what I'm missing now?
    my $OUT_WWW="test"; open ('$OUT_WWW', '>>spool.dat'); #======================================================= format OUT_HEADER= @<<<==== f0rmat HEADER HEADER HEADER Page : @<<< $cc, $cc . format OUT_DETL= @<<<======== f0ramt detail line ============= $cc . #======================================================== $OUT_WWW="OUT_HEADER"; write "$OUT_WWW"; $cc++;