How to find number of bytes written to STDOUT

In a CGI script I write a lot of stuff to STDOUT. Is there an easy way to find how many bytes I have written after I've done it?
LVL 10
rj2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
PC_User321Connect With a Mentor Commented:
After every print add the line
   $TotalLength += length "Put the same string that went to STDOUT in here.  (Variables are OK)";

Alternatively write everything that goes to STDOUT to a temp file too, and check the size of that file.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.