> I would like to use a perl module instead of grep'ing the result of
Getting the IP is pretty platform dependent. If you're on Windows you
can use Win32::IPHelper, but since you mentioned ifconfig I'm assuming
you're not. I'd check out search.cpan.org, and failing that, maybe look
at what's available in your /proc filesystem if your OS has one.