Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 1996 20:39:04 -0500 (EST)
From:      Mike Grupenhoff <kashmir@umiacs.UMD.EDU>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
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:  <Pine.SUN.3.91.960213203344.21111I-100000@xanadu.umiacs.umd.edu>
In-Reply-To: <199602132222.XAA05878@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.960213203344.21111I-100000>