syswrite() is supposed to return the number of bytes actually written and not chocke if there are too much of them. Also, note that syswrite() could return 0 without implying an error (which is signaled by undef). I believe that Linux write(2) actually works like this.
AFAIK, POSIX requires the minimum buffer size for pipes and stuff like that to be at least 512. Most modern system should support greater buffers, and this is why tye uses 4096 (which I remember to be the default size in Linux). To be on the safest side I'd stick to 512, but you could be on a non-POSIX system and need to adjust your aim :)
Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')
Don't fool yourself.In reply to Re: syswrite and STDOUT
by polettix
in thread syswrite and STDOUT
by OverlordQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |