From owner-cvs-gnu Tue Feb 13 17:39:18 1996 Return-Path: owner-cvs-gnu Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA24436 for cvs-gnu-outgoing; Tue, 13 Feb 1996 17:39:18 -0800 (PST) Received: from xanadu.umiacs.UMD.EDU (xanadu.umiacs.umd.edu [128.8.120.51]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id RAA24423 Tue, 13 Feb 1996 17:39:14 -0800 (PST) Received: by xanadu.umiacs.UMD.EDU (8.7.3/UMIACS-0.9/04-05-88) id UAA22702; Tue, 13 Feb 1996 20:39:04 -0500 (EST) Date: Tue, 13 Feb 1996 20:39:04 -0500 (EST) From: Mike Grupenhoff To: 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 In-Reply-To: <199602132222.XAA05878@uriah.heep.sax.de> Message-ID: X-Phase-of-the-Moon: Waning Crescent (38% of Full) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-gnu@FreeBSD.ORG Precedence: bulk On Tue, 13 Feb 1996, J Wunsch wrote: > > Perhaps you should just name the sub "main'gethostname", so calls would > > simply be > > > > require 'gethostname.pl'; > > $thishost = &gethostname; > > I though ``package main;'' is reserved for the base source file? Actually, I meant for you to keep the package name as "gethostname", but name the sub within it "main'gethostname". This "pushes" the sub into the main package. See open2.pl (in the perl lib dir) for an example. Also, if you don't need any variables outside of the sub itself, a package isn't even necessary. See find.pl. mike