From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19584 invoked from network); 29 May 2001 14:33:24 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 14:33:24 -0000 Received: (qmail 22857 invoked by alias); 29 May 2001 14:33:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14538 Received: (qmail 22839 invoked from network); 29 May 2001 14:33:15 -0000 Date: Tue, 29 May 2001 10:33:13 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: cleaner _perl_config_vars() Message-ID: <20010529103313.B32647@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Index: Completion/Unix/Command/_perl =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perl,v retrieving revision 1.1 diff -u -r1.1 _perl --- Completion/Unix/Command/_perl 2001/04/02 11:59:57 1.1 +++ Completion/Unix/Command/_perl 2001/05/29 14:32:08 @@ -46,10 +46,7 @@ _perl_config_vars () { if (( ! $+_perl_config_vars )); then - # perl | perl ... nasty, but is there another way? - _perl_config_vars=( $(perl -V | - perl -ne 'push @m, (/(\w+)(?==)/g);' \ - -e 'END {print join "\n", @m}' ) ) + _perl_config_vars=( $(perl -MConfig -e 'print join("\n", keys %Config);') ) fi local add_colon='-P:' --From Matt Zimmerman-- /usr/share/zsh/4.0.1-pre-5/functions/Completion/Unix/_perl reads: _perl_config_vars () { if (( ! $+_perl_config_vars )); then # perl | perl ... nasty, but is there another way? _perl_config_vars=( $(perl -V | perl -ne 'push @m, (/(\w+)(?==)/g);' \ -e 'END {print join "\n", @m}' ) ) fi Yes, there is another way: perl -MConfig -e 'print join("\n", keys %Config);' is faster, finds more variables, and doesn't misinterpret variable names ('-Darchlib=blah' is seen as a variable named 'Darchlib' by the current code).