Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: perl tar file routines (perltar.perl) Message-ID: <8756@jpl-devvax.JPL.NASA.GOV> Date: 16 Jul 90 22:50:56 GMT References: <1990Jul15.235710.14293@uvaarpa.Virginia.EDU> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 22 In article <1990Jul15.235710.14293@uvaarpa.Virginia.EDU> eichin@athena.mit.edu writes: : Following is "perltar.perl", with the appropriate subroutines. (just : do 'perltar.perl'; : and then use them. Comments on my subroutine style are welcomed; is there a : better way to make perl code *modular* and have rudimentary abstraction?) Yes, consider using the "package" declaration, which lets you have a separate namespace for your code. It basically gives you the ability to differentiate between public and private names. Rudimentary, but nice. : When writing, to write an EOF at the end of the tape, remember to do a : print pack("x8192",1); : before you close your output. (I had trouble with print pack("x8192"); should : I have?) Hmm, well, maybe. Packing nothing to get a null string is probably not the most efficient way. Nowadays "\0" x 8192 is probably more efficient. But if you do use pack that way, since the second argument is a LIST, you can say pack("x8192",()) and pack a null list, which is more satisfactory in some indefinite way. Larry