Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: Portably disabling Nagle's algorithm for TCPby thospel (Hermit) |
on Jan 02, 2005 at 23:08 UTC ( [id://418833]=note: print w/replies, xml ) | Need Help?? |
If you have a modern perl, it will always be defined in Socket.pm, whether your system actually has it or not. In case your system does not have it, calling the constant will cause it
to croak with a message like "Your vendor has not defined Socket macro TCP_NODELAY". This is often what you want, so
you don't have to do anything in that case.
If you want to check at runtime and e.g. only turn nagle off if the constant really is there, you can check with a string eval, e.g: (I also didn't try to import it in case you use a Socket.pm that doesn't even have the constant)
In Section
Seekers of Perl Wisdom
|
|