If you have a definite need to learn how the low-level calls work, then by all means code it yourself. If you want to get a job done, then use the module.
This is actually a pretty good rule of thumb in general: if you need the nuts and bolts (say you're headed into an area that doesn't have any good modules for it), then write it yourself. If someone else has written a module that covers the ground (and that module, when tested in your application, works -- not all CPAN is perfect), then use the module.