in reply to Weird Happening when i print into a file

Change

print FOUT $_jobcard_basename;

to

print FOUT $_jobcard_basename or die ("Can't write to FOUT: $!\n");

to see what's wrong.

Update: If the print doesn't given an error, add

close(FOUT) or die ("Can't write to FOUT: $!\n");

when you're done with the file.

Replies are listed 'Best First'.
Re^2: Weird Happening when i print into a file
by ikegami (Patriarch) on Oct 27, 2008 at 21:59 UTC

    In the CB, the OP reported the above gives him "Bad file number" indicating that FOUT is not open.

      Hear that? That's the sound of everyone who read this post banging his or her head against a wall.