Date: Tue, 13 Feb 1996 19:17:14 -0800 From: Paul Traina <pst@shockwave.com> To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Cc: CVS-committers@freefall.freebsd.org, cvs-gnu@freefall.freebsd.org Subject: Re: cvs commit: src/gnu/usr.bin/perl/lib gethostname.pl Makefile Message-ID: <199602140317.TAA09897@precipice.shockwave.com> In-Reply-To: Your message of "Wed, 14 Feb 1996 00:00:29 %2B0100." <199602132300.AAA06395@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Why don't you just add it to perl? :-) From: J Wunsch <j@uriah.heep.sax.de> Subject: Re: cvs commit: src/gnu/usr.bin/perl/lib gethostname.pl Makefile As Nate Williams wrote: > > Paul Traina writes: > > This is non-standard (albiet nice to have), which will make porting away > > from FBSD more difficult. Caveat Emptor. > > Unless you bring in the package with anything exported from FreeBSD. The problem is that there's no generic way for hooking gethostname(3) into a Perl script. I rather consider this an omission of Perl. Anyway, the simple solution: ------8<-----8<-----8<-----8<-----8<----- package gethostname; sub gethostname { return `hostname`; } 1; ------8<-----8<-----8<-----8<-----8<----- should always do the trick. My concern was to avoid the overhead from the additional process, and the fact that i don't like to call unneeded external programs at all in setuid scripts. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602140317.TAA09897>