From owner-freebsd-ports Mon Dec 14 19:42:48 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA03422 for freebsd-ports-outgoing; Mon, 14 Dec 1998 19:42:48 -0800 (PST) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from mail.HiWAAY.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA03417 for ; Mon, 14 Dec 1998 19:42:46 -0800 (PST) (envelope-from sprice@hiwaay.net) Received: from localhost (sprice@localhost) by mail.HiWAAY.net (8.9.1a/8.9.0) with SMTP id VAA16888; Mon, 14 Dec 1998 21:42:40 -0600 (CST) Date: Mon, 14 Dec 1998 21:42:40 -0600 (CST) From: Steve Price To: John Baldwin cc: freebsd-ports@FreeBSD.ORG Subject: Re: make index breaks at top level In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, 14 Dec 1998, John Baldwin wrote: # Actually, it didn't like the "my $name" lines so I just replaced # # my $name = shift; # # with # # $name = shift; Ick. I didn't know 'my' was a version 5 only thing. :( # I still ended up with two errors afterwards, though: # # # perl -c make_index # syntax error in file make_index at line 33, next 2 tokens "->" # syntax error in file make_index at line 38, next 2 tokens "@$pkg" # make_index had compilation errors. You will definitely have to use version 5 to fix these. # - From the offending code lines, it would seem that they are # trying to treat pkg as an array of structs instead of a struct # as it is treated elsewhere. I'm not Perl literate, though, so Actually it is a hash of hashes and they are all being treated the same. :) # that is just a guess. I suppose Perl5 let's you get away with # stuff 4 didn't? Yep, version 5 let's you do a lot more obfuscated tricks that version 4 didn't. # Another fix might be to have ports/makefile use # perl5 to run the script instead of perl, but then you are requiring # users prior to 3.x to install a port so they can use the ports. # Thanks for responding though. Actually this (index) is not intended as a target for general consumption. It is there so that we can easily create a new INDEX. You can use it if you like, but if you do I'd suggest you install the lasted version of perl from the ports tree. # BTW, can somebody please tell me what the "my $" does # anyway? (i.e. will it break if it is taken out or is it simply # an optimization). You can usually safely replace 'my' with 'local'. And yes it is an optimization of sorts. Without going into great detail, 'my' variables are lexically scoped and 'local' are dynamically scoped. For example, if I have two routines foo and bar like this: sub foo { my $foo1; # only defined within foo local $foo2; # defined within foo and any routines it calls bar(); } sub bar { # $foo1 is not visible here # but $foo2 is } So it is a little faster and a little safer to use 'my'. -steve # - --- # # John Baldwin -- http://members.freedomnet.com/~jbaldwin/ # PGP Key: http://members.freedomnet.com/~jbaldwin/pgpkey.asc # # ICna tpyr 100w rods pdr munuiet~!!1 # # # -----BEGIN PGP SIGNATURE----- # Version: 2.6.2 # # iQB1AwUBNnXUPIjYza302vYpAQGIIgL+MXBGDJkyfG/VTGHr/DEamlF7nL/jKaR1 # qxK3qeCx446iPEFVQBqnpFmXm5q8cyGXaIsuE/WUdlLIhuy6R/3kDEwqUa6eG7l/ # Ql1wsghM3xfecEhcx2JNg0TmECMOslwg # =/vk2 # -----END PGP SIGNATURE----- # To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message