develooper Front page | perl.perl5.porters | Postings from July 2001

[PATCH perlsnap] '-' !~ /\w/

Thread Next
From:
Philip Newton
Date:
July 1, 2001 00:33
Subject:
[PATCH perlsnap] '-' !~ /\w/
Message ID:
perl.perl5.porters-39481@nntp.perl.org
I was looking through the changes that had accumulated over the weekend
on the perl5-changes mailing list, and have a couple of nits. Here's
the first.

Jonathan Stowe added ext/NDBM_File/hints/linux.pl with a test to see
whether -ldgbm appeared in $Config{libs}. As far as I can tell,
$Config{libs} is a space-separated list. However '-' does not match
/\w/, so there is no \b between ' ' and '-', nor between the \W
character before start-of-string and '-'. Hence, I changed the \b at
the beginning to \B. This will now match '-lgdbm -lfoo' and
'-lfoo -lgdbm' (and also '-foo,-lgdbm' since ',' is also \W) but not
'-lnew-lgdbm' .

--- ext/NDBM_File/hints/linux.pl.orig   Wed Jun 27 13:52:11 2001
+++ ext/NDBM_File/hints/linux.pl        Sun Jul  1 07:02:36 2001
@@ -3,4 +3,4 @@
 # (no null key support)
 # Jonathan Stowe <gellyfish@gellyfish.com>
 use Config;
-$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /\b-lgdbm\b/;
+$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /\B-lgdbm\b/;
End of patch.

Cheers,
Philip
-- 
Philip Newton <Philip.Newton@gmx.net>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About