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

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

Thread Next
Philip Newton
July 1, 2001 00:33
[PATCH perlsnap] '-' !~ /\w/
Message ID:
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/ 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/   Wed Jun 27 13:52:11 2001
+++ ext/NDBM_File/hints/        Sun Jul  1 07:02:36 2001
@@ -3,4 +3,4 @@
 # (no null key support)
 # Jonathan Stowe <>
 use Config;
-$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /\b-lgdbm\b/;
+$self->{LIBS} = ['-lgdbm'] if $Config{libs} =~ /\B-lgdbm\b/;
End of patch.

Philip Newton <>

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About