break utime() so that over NFS the timestamps do not get changed
(on local filesystems utime() still works).
+Building Perl on a system that has also BIND (headers and libraries)
+installed may run into troubles because BIND installs its own netdb.h
+and socket.h, which may not agree with the operating system's ideas of
+the same files. Similarly, including -lbind may conflict with libc's
+view of the world. You may have to tweak -Dlocincpth and -Dloclibpth
+to avoid the BIND.
+
=back
=head2 Cross-compilation
ext/POSIX/POSIX.pm POSIX extension Perl module
ext/POSIX/POSIX.pod POSIX extension documentation
ext/POSIX/POSIX.xs POSIX extension external subroutines
+ext/POSIX/t/is.t See if POSIX isxxx() work
ext/POSIX/t/posix.t See if POSIX works
ext/POSIX/t/sigaction.t See if POSIX::sigaction works
ext/POSIX/t/taint.t See if POSIX works with taint
Quick cycle of developers release may break the OS/2 build time to
time, looking into
- http://www.cpan.org/ports/os2/ilyaz/
+ http://www.cpan.org/ports/os2/
may indicate the latest release which was publicly released by the
maintainer. Note that the release may include some additional patches
END {
# unlink may fail if applied directly to a large file
- open(BIG, ">big");
- print BIG "x";
+ # be paranoid about leaving 5 gig files lying around
+ open(BIG, ">big"); # truncate
close(BIG);
- unlink "big"; # be paranoid about leaving 5 gig files lying around
+ 1 while unlink "big"; # standard portable idiom
}
# eof
The available functions and the gdbm/perl interface need to be documented.
+The GDBM error number and error message interface needs to be added.
+
=head1 SEE ALSO
L<perl(1)>, L<DB_File(3)>, L<perldbmfilter>.
@ISA = qw(Tie::Hash Exporter);
@EXPORT = qw(
GDBM_CACHESIZE
+ GDBM_CENTFREE
+ GDBM_COALESCEBLKS
GDBM_FAST
+ GDBM_FASTMODE
GDBM_INSERT
GDBM_NEWDB
GDBM_NOLOCK
+ GDBM_OPENMASK
GDBM_READER
GDBM_REPLACE
+ GDBM_SYNC
+ GDBM_SYNCMODE
GDBM_WRCREAT
GDBM_WRITER
);
-$VERSION = "1.06";
+$VERSION = "1.07";
sub AUTOLOAD {
my($constname);
NAME => 'GDBM_File',
DEFAULT_TYPE => 'IV',
BREAKOUT_AT => 8,
- NAMES => [qw(GDBM_CACHESIZE GDBM_FAST GDBM_FASTMODE GDBM_INSERT GDBM_NEWDB
- GDBM_NOLOCK GDBM_READER GDBM_REPLACE GDBM_WRCREAT
- GDBM_WRITER)],
+ NAMES => [qw(GDBM_CACHESIZE GDBM_CENTFREE GDBM_COALESCEBLKS
+ GDBM_FAST GDBM_FASTMODE GDBM_INSERT GDBM_NEWDB GDBM_NOLOCK
+ GDBM_OPENMASK GDBM_READER GDBM_REPLACE GDBM_SYNC GDBM_SYNCMODE
+ GDBM_WRCREAT GDBM_WRITER)],
);
--- /dev/null
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require Config; import Config;
+ if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) {
+ print "1..0\n";
+ exit 0;
+ }
+}
+
+
+use POSIX;
+use strict ;
+
+$| = 1;
+
+
+# List of characters (and strings) to feed to the is<xxx> functions.
+#
+# The left-hand side (key) is a character or string.
+# The right-hand side (value) is a list of character classes to which
+# this string belongs. This is a *complete* list: any classes not
+# listed, are expected to return '0' for the given string.
+my %classes =
+ (
+ 'a' => [ qw(print graph alnum alpha lower xdigit) ],
+ 'A' => [ qw(print graph alnum alpha upper xdigit) ],
+ 'z' => [ qw(print graph alnum alpha lower) ],
+ 'Z' => [ qw(print graph alnum alpha upper) ],
+ '0' => [ qw(print graph alnum digit xdigit) ],
+ '9' => [ qw(print graph alnum digit xdigit) ],
+ '.' => [ qw(print graph punct) ],
+ '?' => [ qw(print graph punct) ],
+ ' ' => [ qw(print space) ],
+ "\t" => [ qw(cntrl space) ],
+ "\001" => [ qw(cntrl) ],
+
+ # Multi-character strings. These are logically ANDed, so the
+ # presence of different types of chars in one string will
+ # reduce the list on the right.
+ 'abc' => [ qw(print graph alnum alpha lower xdigit) ],
+ 'az' => [ qw(print graph alnum alpha lower) ],
+ 'aZ' => [ qw(print graph alnum alpha) ],
+ 'abc ' => [ qw(print) ],
+
+ '012aF' => [ qw(print graph alnum xdigit) ],
+
+ " \t" => [ qw(space) ],
+
+ "abcde\001" => [],
+ );
+
+
+# Pass 1: convert the above arrays to hashes. While doing so, obtain
+# a complete list of all the 'is<xxx>' functions. At least, the ones
+# listed above.
+my %functions;
+foreach my $s (keys %classes) {
+ $classes{$s} = { map {
+ $functions{"is$_"}++; # Keep track of all the 'is<xxx>' functions
+ "is$_" => 1; # Our return value: is<xxx>($s) should pass.
+ } @{$classes{$s}} };
+}
+
+# Expected number of tests is one each for every combination of a
+# known is<xxx> function and string listed above.
+require './test.pl';
+plan(tests => keys(%classes) * keys(%functions));
+
+
+#
+# Main test loop: Run all POSIX::is<xxx> tests on each string defined above.
+# Only the character classes listed for that string should return 1. We
+# always run all functions on every string, and expect to get 0 for the
+# character classes not listed in the given string's hash value.
+#
+foreach my $s (sort keys %classes) {
+ foreach my $f (sort keys %functions) {
+ my $expected = exists $classes{$s}->{$f};
+ my $actual = eval "POSIX::$f( \$s )";
+
+ ok( $actual == $expected, "$f('$s') == $actual");
+ }
+}
sub _charblocks {
unless (@BLOCKS) {
if (openunicode(\$BLOCKSFH, "Blocks.txt")) {
+ local $_;
while (<$BLOCKSFH>) {
if (/^([0-9A-F]+)\.\.([0-9A-F]+);\s+(.+)/) {
my ($lo, $hi) = (hex($1), hex($2));
sub _charscripts {
unless (@SCRIPTS) {
if (openunicode(\$SCRIPTSFH, "Scripts.txt")) {
+ local $_;
while (<$SCRIPTSFH>) {
if (/^([0-9A-F]+)(?:\.\.([0-9A-F]+))?\s+;\s+(\w+)/) {
my ($lo, $hi) = (hex($1), $2 ? hex($2) : hex($1));
sub _compexcl {
unless (%COMPEXCL) {
if (openunicode(\$COMPEXCLFH, "CompositionExclusions.txt")) {
+ local $_;
while (<$COMPEXCLFH>) {
if (/^([0-9A-F]+)\s+\#\s+/) {
my $code = hex($1);
sub _casefold {
unless (%CASEFOLD) {
if (openunicode(\$CASEFOLDFH, "CaseFolding.txt")) {
+ local $_;
while (<$CASEFOLDFH>) {
if (/^([0-9A-F]+); ([CFSI]); ([0-9A-F]+(?: [0-9A-F]+)*);/) {
my $code = hex($1);
sub _casespec {
unless (%CASESPEC) {
if (openunicode(\$CASESPECFH, "SpecialCasing.txt")) {
+ local $_;
while (<$CASESPECFH>) {
if (/^([0-9A-F]+); ([0-9A-F]+(?: [0-9A-F]+)*)?; ([0-9A-F]+(?: [0-9A-F]+)*)?; ([0-9A-F]+(?: [0-9A-F]+)*)?; (\w+(?: \w+)*)?/) {
my ($hexcode, $lower, $title, $upper, $condition) =
use Unicode::UCD;
use Test::More;
-BEGIN { plan tests => 162 };
+BEGIN { plan tests => 164 };
use Unicode::UCD 'charinfo';
$casespec->{az}->{upper} eq '0307' &&
$casespec->{az}->{condition} eq 'az After_Soft_Dotted',
'casespec 0x307');
+
+# perl #7305 UnicodeCD::compexcl is weird
+
+for (1) {$a=compexcl $_}
+ok(1, 'compexcl read-only $_: perl #7305');
+grep {compexcl $_} %{{1=>2}};
+ok(1, 'compexcl read-only hash: perl #7305');
+
+
+
=item Filehandle %s opened only for input
-(W io) You tried to write on a read-only filehandle. If you intended it
-to be a read-write filehandle, you needed to open it with "+<" or "+>"
-or "+>>" instead of with "<" or nothing. If you intended only to write
-the file, use ">" or ">>". See L<perlfunc/open>.
+(W io) You tried to write on a read-only filehandle. If you intended
+it to be a read-write filehandle, you needed to open it with "+<" or
+"+>" or "+>>" instead of with "<" or nothing. If you intended only to
+write the file, use ">" or ">>". See L<perlfunc/open>.
=item Filehandle %s opened only for output
-(W io) You tried to read from a filehandle opened only for writing.
-If you intended it to be a read/write filehandle, you needed to open it
+(W io) You tried to read from a filehandle opened only for writing, If
+you intended it to be a read/write filehandle, you needed to open it
with "+<" or "+>" or "+>>" instead of with "<" or nothing. If you
intended only to read from the file, use "<". See L<perlfunc/open>.
+Another possibility is that you attempted to open filedescriptor 0
+(also known as STDIN) for output (maybe you closed STDIN earlier?).
=item Filehandle %s reopened as %s only for input
#!./perl
-print "1..77\n";
+print "1..78\n";
eval 'print "ok 1\n";';
eval q{};
print length($@) ? "not ok 46\t# \$\@ = '$@'\n" : "ok 46\n";
}
+# [perl #9728] used to dump core
+{
+ $eval = eval 'sub { eval "sub { %S }" }';
+ $eval->({});
+ print "ok 47\n";
+}
# DAPM Nov-2002. Perl should now capture the full lexical context during
# evals.
# grep() and map() tests
#
-print "1..32\n";
+print "1..33\n";
$test = 1;
print "# @x,$y\n";
print "@x,$y" eq "3 4,1212" ? "ok $test\n" : "not ok $test\n";
$test++;
+
+ # Add also a sample test from [perl #18153]. (The same bug).
+ $a = 1; map {if ($a){}} (2);
+ print "ok $test\n"; # no core dump is all we need
+ $test++;
}
+
END {
# unlink may fail if applied directly to a large file
- open(BIG, ">big");
- print BIG "x";
+ # be paranoid about leaving 5 gig files lying around
+ open(BIG, ">big"); # truncate
close(BIG);
- unlink "big"; # be paranoid about leaving 5 gig files lying around
+ 1 while unlink "big"; # standard portable idiom
}
# eof
}
require './test.pl';
-plan( tests => 122 );
+plan( tests => 124 );
$x = 'foo';
$_ = "x";
is($b, "$na--$na--$nb", "s///: replace long non-utf8 into non-utf8 (utf8 pattern)");
}
+$_ = 'aaaa';
+$r = 'x';
+$s = s/a(?{})/$r/g;
+is("<$_> <$s>", "<xxxx> <4>", "perl #7806");
+
+$_ = 'aaaa';
+$s = s/a(?{})//g;
+is("<$_> <$s>", "<> <4>", "perl #7806");
+