From: Gurusamy Sarathy Date: Tue, 11 Jul 2000 20:37:23 +0000 (+0000) Subject: integrate cfgperl changes#6325..6373 into mainline X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c2e66d9e68806a7000ee1a4760c35703a0e0ae89;p=p5sagit%2Fp5-mst-13.2.git integrate cfgperl changes#6325..6373 into mainline (NOTE: today's batch of integrations still untested) p4raw-link: @6373 (not found) p4raw-link: @6325 on //depot/cfgperl: d6ac44cc5a00fa38a56717785146bc16b716472c p4raw-id: //depot/perl@6373 --- diff --git a/Changes b/Changes index 5269456..f86a8c1 100644 --- a/Changes +++ b/Changes @@ -93,6 +93,198 @@ Version v5.7.0 Development release working toward v5.8 -------------- ____________________________________________________________________________ +[ 6371] By: jhi on 2000/07/11 20:08:56 + Log: Minor cleanups on the booklist. + Branch: cfgperl + ! pod/perlfaq2.pod +____________________________________________________________________________ +[ 6370] By: jhi on 2000/07/11 19:31:13 + Log: mjd's tr patches "broke" tr/z-Z/z-Z/ + Branch: cfgperl + ! t/pragma/overload.t +____________________________________________________________________________ +[ 6369] By: gsar on 2000/07/11 19:27:48 + Log: integrate cfgperl changes#6293..6324 into mainline + Branch: perl + +> lib/Win32.pod lib/lib_pm.PL pod/Makefile.SH pod/buildtoc.PL + - lib/lib.pm.PL pod/Makefile pod/Win32.pod pod/buildtoc + !> (integrate 30 files) +____________________________________________________________________________ +[ 6368] By: gsar on 2000/07/11 19:18:57 + Log: skip integrate of problematic change#6292 from cfgperl into mainline + Branch: perl + !> pp_hot.c +____________________________________________________________________________ +[ 6367] By: gsar on 2000/07/11 19:17:21 + Log: integrate cfgperl changes#6288..6290 into mainline + Branch: perl + !> lib/File/Spec/Functions.pm lib/File/Spec/OS2.pm +____________________________________________________________________________ +[ 6366] By: gsar on 2000/07/11 19:11:18 + Log: integrate cfgperl changes#6268..6282 into mainline + Branch: perl + !> (integrate 30 files) +____________________________________________________________________________ +[ 6365] By: gsar on 2000/07/11 18:57:00 + Log: delete new accidentally branched file + Branch: perl + - t/op/method2entersub.t +____________________________________________________________________________ +[ 6364] By: gsar on 2000/07/11 18:55:13 + Log: skip integrate of change#6267 from cfgperl into mainline (the + method call optimization is flawed without additional hints + from user about immutableness of @ISA and no runtime method + definitions) + Branch: perl + +> t/op/method2entersub.t + !> MANIFEST embed.pl lib/ExtUtils/Install.pm lib/base.pm op.c + !> perl.h t/op/sprintf.t xsutils.c +____________________________________________________________________________ +[ 6363] By: gsar on 2000/07/11 18:49:43 + Log: integrate cfgperl changes#6261..6266 into mainline + Branch: perl + !> README.epoc cygwin/Makefile.SHs doop.c epoc/config.sh + !> epoc/createpkg.pl epoc/epocish.c epoc/epocish.h + !> ext/POSIX/POSIX.pm ext/POSIX/POSIX.pod ext/POSIX/POSIX.xs + !> hints/bsdos.sh pod/perldiag.pod t/comp/require.t toke.c +____________________________________________________________________________ +[ 6362] By: gsar on 2000/07/11 18:43:26 + Log: integrate cfgperl changes#6252..6260 into mainline + Branch: perl + !> MANIFEST doop.c embed.h embed.pl embedvar.h lib/Exporter.pm + !> lib/IPC/Open3.pm objXSUB.h op.c pod/perlfunc.pod pp.c + !> pp_proto.h proto.h sv.c t/op/my_stash.t t/op/pack.t t/op/tr.t + !> t/pragma/constant.t t/pragma/warn/op t/pragma/warn/regcomp +____________________________________________________________________________ +[ 6361] By: gsar on 2000/07/11 18:37:12 + Log: skip integrate of problematic change#6251 from cfgperl into mainline + Branch: perl + !> lib/Exporter.pm +____________________________________________________________________________ +[ 6360] By: gsar on 2000/07/11 18:34:56 + Log: integrate cfgperl change#6250 into mainline + Branch: perl + +> t/op/my_stash.t + !> MANIFEST embed.pl proto.h toke.c +____________________________________________________________________________ +[ 6359] By: gsar on 2000/07/11 18:21:19 + Log: integrate cfgperl changes#6242..6249 into mainline + Branch: perl + !> embed.h embed.pl embedvar.h ext/DynaLoader/DynaLoader_pm.PL + !> gv.c lib/File/Spec.pm lib/IPC/Open3.pm objXSUB.h perlapi.c + !> perlapi.h pod/perlapi.pod pod/perlfunc.pod pod/perlintern.pod + !> pp_proto.h proto.h sv.c t/lib/filefunc.t t/lib/filespec.t + !> t/lib/peek.t utf8.c +____________________________________________________________________________ +[ 6358] By: gsar on 2000/07/11 18:15:45 + Log: skip integrate of problematic change#6241 from cfgperl into mainline + Branch: perl + !> regcomp.c t/pragma/warn/regcomp t/pragma/warn/toke toke.c +____________________________________________________________________________ +[ 6357] By: jhi on 2000/07/11 18:15:16 + Log: Fix for + Subject: [ID 20000711.005] spurious uninit warning with msgrcv() + From: Roderick Schertler + Date: Tue, 11 Jul 2000 13:55:05 -0400 + Message-Id: <200007111755.NAA05077@jones.argon.org> + Branch: cfgperl + ! doio.c +____________________________________________________________________________ +[ 6356] By: jhi on 2000/07/11 18:12:51 + Log: Typo in #6341. + Branch: cfgperl + ! pp_hot.c +____________________________________________________________________________ +[ 6355] By: gsar on 2000/07/11 18:12:10 + Log: integrate cfgperl changes#6231..6240 into mainline + Branch: perl + +> pod/perlutil.pod + !> (integrate 35 files) +____________________________________________________________________________ +[ 6354] By: jhi on 2000/07/11 18:04:34 + Log: Subject: [PATCH perl-current] Make op/sprintf.t more comprehensive, take 2 + From: Dominic Dunlop + Date: Tue, 11 Jul 2000 12:27:33 +0200 + Message-Id: + + Replaces change #6268. + Branch: cfgperl + ! t/op/sprintf.t +____________________________________________________________________________ +[ 6353] By: gsar on 2000/07/11 17:59:51 + Log: skip integrate of problematic change#6230 from cfgperl into mainline + (a later version of File::Spec is already in mainline) + Branch: perl + !> lib/File/Spec.pm lib/File/Spec/Functions.pm + !> lib/File/Spec/OS2.pm t/lib/filefunc.t t/lib/filespec.t +____________________________________________________________________________ +[ 6352] By: gsar on 2000/07/11 17:57:48 + Log: integrate cfgperl changes#6224..6229 into mainline + Branch: perl + +> lib/lib.pm.PL + - lib/lib.pm + !> MANIFEST Makefile.SH README.hpux embed.pl ext/Socket/Socket.pm + !> lib/English.pm op.c t/lib/english.t +____________________________________________________________________________ +[ 6351] By: gsar on 2000/07/11 17:50:10 + Log: skip integrate of problematic change#6223 from cfgperl into mainline + Branch: perl + !> doio.c +____________________________________________________________________________ +[ 6350] By: gsar on 2000/07/11 17:48:28 + Log: integrate cfgperl changes#6220..6222 into mainline + Branch: perl + !> doop.c embed.pl lib/Pod/Usage.pm makedef.pl pod/perlop.pod + !> toke.c utf8.c win32/win32.h +____________________________________________________________________________ +[ 6349] By: gsar on 2000/07/11 17:46:13 + Log: skip integrate of problematic changes#6218..6219 from cfgperl into + mainline + Branch: perl + !> bytecode.pl ext/B/B/Assembler.pm ext/B/B/Bytecode.pm + !> ext/B/O.pm ext/B/defsubs_h.PL ext/ByteLoader/ByteLoader.pm + !> ext/ByteLoader/ByteLoader.xs ext/ByteLoader/bytecode.h +____________________________________________________________________________ +[ 6348] By: jhi on 2000/07/11 17:45:49 + Log: README.posix-bc podified from Thomas Dorner. + Branch: cfgperl + ! README.posix-bc +____________________________________________________________________________ +[ 6347] By: gsar on 2000/07/11 17:42:04 + Log: integrate cfgperl change#6217 into mainline + Branch: perl + !> Configure config_h.SH doio.c embed.h embed.pl embedvar.h gv.c + !> intrpvar.h objXSUB.h perl.c perlapi.h pp.c pp_ctl.c proto.h + !> sv.h util.c util.h vmesa/vmesa.c win32/win32.c +____________________________________________________________________________ +[ 6346] By: gsar on 2000/07/11 17:39:37 + Log: skip integrate of problematic changes#6211..6212 from cfgperl into + mainline + Branch: perl + !> embedvar.h ext/B/B.xs ext/B/B/Asmdata.pm ext/B/defsubs_h.PL + !> ext/ByteLoader/ByteLoader.xs ext/ByteLoader/bytecode.h + !> ext/ByteLoader/byterun.c ext/ByteLoader/byterun.h perlapi.c + !> perlapi.h pod/perlapi.pod +____________________________________________________________________________ +[ 6345] By: gsar on 2000/07/11 17:36:42 + Log: integrate cfgperl changes#6207..6210 into mainline + Branch: perl + !> doio.c embed.h embed.pl gv.c intrpvar.h objXSUB.h perl.c pp.c + !> pp_ctl.c proto.h sv.h util.c vmesa/vmesa.c win32/win32.c +____________________________________________________________________________ +[ 6344] By: gsar on 2000/07/11 17:31:20 + Log: skip integrate of problematic changes#6204..6206 from cfgperl into + mainline + Branch: perl + !> (integrate 40 files) +____________________________________________________________________________ +[ 6343] By: gsar on 2000/07/11 17:19:08 + Log: integrate cfgperl changes#6174..6203 into mainline (first of several) + Branch: perl + +> Makefile.micro README.micro Todo.micro uconfig.h uconfig.sh + ! Changes + !> (integrate 34 files) +____________________________________________________________________________ [ 6342] By: jhi on 2000/07/11 16:05:48 Log: Subject: [ID 20000710.002] fatal error or memory loss when deleting symbols in evaled code with syntax errors To: perl5-porters@perl.org diff --git a/MANIFEST b/MANIFEST index 16893a5..68afd78 100644 --- a/MANIFEST +++ b/MANIFEST @@ -251,6 +251,7 @@ ext/DynaLoader/dl_vms.xs VMS implementation ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files ext/DynaLoader/hints/aix.pl Hint for DynaLoader for named architecture ext/DynaLoader/hints/linux.pl Hint for DynaLoader for named architecture +ext/DynaLoader/hints/netbsd.pl Hint for DynaLoader for named architecture ext/DynaLoader/hints/openbsd.pl Hint for DynaLoader for named architecture ext/Errno/ChangeLog Errno perl module change log ext/Errno/Errno_pm.PL Errno perl module create script @@ -1127,7 +1128,7 @@ pod/perl5005delta.pod Changes from 5.004 to 5.005 pod/perl56delta.pod Changes from 5.005 to 5.6 pod/perlapi.pod Perl API documentation (autogenerated) pod/perlapio.pod IO API info -pod/perlbook.pod Book info +pod/perlbook.pod Perl book information pod/perlboot.pod Beginner's Object-oriented Tutorial pod/perlbot.pod Object-oriented Bag o' Tricks pod/perlcall.pod Callback info diff --git a/README.posix-bc b/README.posix-bc index 1105f67..3dd8ea2 100644 --- a/README.posix-bc +++ b/README.posix-bc @@ -1,28 +1,43 @@ -This is a first ported perl for the POSIX subsystem in BS2000 VERSION -'V121', OSD V3.1, POSIX Shell V03.1A55. It may work on other -versions, but that's the one we've tested it on. +This document is written in pod format hence there are punctuation +characters in in odd places. Do not worry, you've apparently got the +ASCII->EBCDIC translation worked out correctly. You can read more +about pod in pod/perlpod.pod or the short summary in the INSTALL file. + +=head1 NAME + +README.posix-bc - building and installing Perl for BS2000 POSIX. + +=head1 SYNOPSIS + +This document will help you Configure, build, test and install Perl +on BS2000 in the POSIX subsystem. + +=head1 DESCRIPTION + +This is a ported perl for the POSIX subsystem in BS2000 VERSION OSD +V3.1A. It may work on other versions, but that's the one we've tested +it on. You may need the following GNU programs in order to install perl: -gzip: +=head2 gzip We used version 1.2.4, which could be installed out of the box with one failure during 'make check'. -bison: +=head2 bison The yacc coming with BS2000 POSIX didn't work for us. So we had to use bison. We had to make a few changes to perl in order to use the pure (reentrant) parser of bison. We used version 1.25, but we had to add a few changes due to EBCDIC. - -UNPACKING: -========== +=head2 Unpacking To extract an ASCII tar archive on BS2000 POSIX you need an ASCII filesystem (we used the mountpoint /usr/local/ascii for this). Now -you extract the archive in the ASCII filesystem without I/O-conversion: +you extract the archive in the ASCII filesystem without +I/O-conversion: cd /usr/local/ascii export IO_CONVERSION=NO @@ -30,24 +45,20 @@ gunzip < /usr/local/src/perl.tar.gz | pax -r You may ignore the error message for the first element of the archive (this doesn't look like a tar archive / skipping to next file...), -it's only the directory which will be made anyway. +it's only the directory which will be created automatically anyway. After extracting the archive you copy the whole directory tree to your -EBCDIC filesystem. This time you use I/O-conversion: +EBCDIC filesystem. B: cd /usr/local/src IO_CONVERSION=YES cp -r /usr/local/ascii/perl5.005_02 ./ - -COMPILING: -========== +=head2 Compiling There is a "hints" file for posix-bc that specifies the correct values for most things. The major problem is (of course) the EBCDIC character -set. - -Configure did everything except the perl parser. +set. We have german EBCDIC version. Because of our problems with the native yacc we used GNU bison to generate a pure (=reentrant) parser for perly.y. So our yacc is @@ -85,16 +96,15 @@ We still use the normal yacc for a2p.y though!!! We made a softlink called byacc to distinguish between the two versions: ln -s /usr/bin/yacc /usr/local/bin/byacc - -We build perl using both GNU make and the native make. +We build perl using GNU make. We tried the native make once and it +worked too. -TESTING: -======== +=head2 Testing -We still got a few errors during 'make test'. Some of them are the -result of using bison. Bison prints 'parser error' instead of 'syntax -error', so we may ignore them. The following list shows +We still got a few errors during C. Some of them are the +result of using bison. Bison prints I instead of I, so we may ignore them. The following list shows our errors, your results may differ: op/numconvert.......FAILED tests 1409-1440 @@ -108,20 +118,45 @@ lib/complex.........FAILED tests 267, 487 lib/dumper..........FAILED tests 43, 45 Failed 11/231 test scripts, 95.24% okay. 57/10595 subtests failed, 99.46% okay. -INSTALLING: -=========== +=head2 Install We have no nroff on BS2000 POSIX (yet), so we ignored any errors while installing the documentation. -USING PERL: -=========== +=head2 Using Perl BS2000 POSIX doesn't support the shebang notation -('#!/usr/local/bin/perl'), so you have to use the following lines +(C<#!/usr/local/bin/perl>), so you have to use the following lines instead: : # use perl eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; + +=head1 AUTHORS + +Thomas Dorner + +=head1 SEE ALSO + +L, L. + +=head2 Mailing list + +The Perl Institute (http://www.perl.org/) maintains a perl-mvs mailing +list of interest to all folks building and/or using perl on EBCDIC +platforms. To subscibe, send a message of: + + subscribe perl-mvs + +to majordomo@perl.org. + +=head1 HISTORY + +This document was originally written by Thomas Dorner for the 5.005 +release of Perl. + +This document was podified for the 5.6 release of perl 11 July 2000. + +=cut diff --git a/doio.c b/doio.c index 8789df9..19f7861 100644 --- a/doio.c +++ b/doio.c @@ -1917,6 +1917,9 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp) id = SvIVx(*++mark); mstr = *++mark; + /* suppress warning when reading into undef var --jhi */ + if (! SvOK(mstr)) + sv_setpvn(mstr, "", 0); msize = SvIVx(*++mark); mtype = (long)SvIVx(*++mark); flags = SvIVx(*++mark); diff --git a/ext/Devel/DProf/DProf.xs b/ext/Devel/DProf/DProf.xs index 31e984f..7167a00 100644 --- a/ext/Devel/DProf/DProf.xs +++ b/ext/Devel/DProf/DProf.xs @@ -502,7 +502,7 @@ prof_record(pTHX) static void check_depth(pTHX_ void *foo) { - U32 need_depth = (U32)foo; + U32 need_depth = PTR2UV(foo); if (need_depth != g_depth) { if (need_depth > g_depth) { warn("garbled call depth when profiling"); diff --git a/ext/DynaLoader/hints/netbsd.pl b/ext/DynaLoader/hints/netbsd.pl new file mode 100644 index 0000000..a0fbaf7 --- /dev/null +++ b/ext/DynaLoader/hints/netbsd.pl @@ -0,0 +1,3 @@ +# XXX Configure test needed? +# Some NetBSDs seem to have a dlopen() that won't accept relative paths +$self->{CCFLAGS} = $Config{ccflags} . ' -DDLOPEN_WONT_DO_RELATIVE_PATHS'; diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod index 9abad2a..314147c 100644 --- a/ext/POSIX/POSIX.pod +++ b/ext/POSIX/POSIX.pod @@ -95,7 +95,7 @@ I. =item acos This is identical to the C function C, returning -the arcus cosine of its numerical argument. +the arcus cosine of its numerical argument. See also L. =item alarm @@ -121,7 +121,7 @@ default to zero (and the first two are usually ignored anyway). =item asin This is identical to the C function C, returning -the arcus sine of its numerical argument. +the arcus sine of its numerical argument. See also L. =item assert @@ -131,13 +131,13 @@ to achieve similar things. =item atan This is identical to the C function C, returning the -arcus tangent of its numerical argument. +arcus tangent of its numerical argument. See also L. =item atan2 This is identical to Perl's builtin C function, returning the arcus tangent defined by its two numerical arguments, the I -coordinate and the I coordinate. +coordinate and the I coordinate. See also L. =item atexit @@ -220,11 +220,12 @@ a directory handle, see L. This is identical to Perl's builtin C function, for returning the cosine of its numerical argument, see L. +See also L. =item cosh This is identical to the C function C, for returning -the hyperbolic cosine of its numeric argument. +the hyperbolic cosine of its numeric argument. See also L. =item creat @@ -334,7 +335,7 @@ the absolute value of the numerical argument, see L. =item fclose -Use method C instead. +Use method C instead, or see L. =item fcntl @@ -343,11 +344,11 @@ see L. =item fdopen -Use method C instead. +Use method C instead, or see L. =item feof -Use method C instead. +Use method C instead, or see L. =item ferror @@ -356,14 +357,15 @@ Use method C instead. =item fflush Use method C instead. +See also L. =item fgetc -Use method C instead. +Use method C instead, or see L. =item fgetpos -Use method C instead. +Use method C instead, or see L. =item fgets @@ -372,7 +374,7 @@ as L. =item fileno -Use method C instead. +Use method C instead, or see L. =item floor @@ -391,11 +393,13 @@ less than the magnitude of C<$y>. =item fopen -Use method C instead. +Use method C instead, or see L. =item fork -This is identical to Perl's builtin C function. +This is identical to Perl's builtin C function +for duplicating the current process, see L +and L if you are in Windows. =item fpathconf @@ -446,11 +450,11 @@ fscanf() is C-specific, use EE and regular expressions instead. =item fseek -Use method C instead. +Use method C instead, or see L. =item fsetpos -Use method C instead. +Use method C instead, or seek L. =item fstat @@ -463,7 +467,7 @@ Perl's builtin C function. =item ftell -Use method C instead. +Use method C instead, or see L. =item fwrite @@ -648,7 +652,7 @@ C construct instead, or simply C. =item kill This is identical to Perl's builtin C function for sending -signals to processes (oftern to terminate them), see L. +signals to processes (often to terminate them), see L. =item labs @@ -1124,12 +1128,13 @@ Returns C on failure. This is identical to Perl's builtin C function for returning the sine of the numerical argument, -see L. +see L. See also L. =item sinh This is identical to the C function C for returning the hyperbolic sine of the numerical argument. +See also L. =item sleep @@ -1352,12 +1357,12 @@ L. =item tan This is identical to the C function C, returning the -tangent of the numerical argument. +tangent of the numerical argument. See also L. =item tanh This is identical to the C function C, returning the -hyperbolic tangent of the numerical argument. +hyperbolic tangent of the numerical argument. See also L. =item tcdrain diff --git a/lib/Symbol.pm b/lib/Symbol.pm index a842c1c..a95383a 100644 --- a/lib/Symbol.pm +++ b/lib/Symbol.pm @@ -129,8 +129,15 @@ sub delete_package ($) { my $stem_symtab = *{$stem}{HASH}; return unless defined $stem_symtab and exists $stem_symtab->{$leaf}; - my $leaf_glob = $stem_symtab->{$leaf}; - my $leaf_symtab = *{$leaf_glob}{HASH}; + + # free all the symbols in the package + + my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH}; + foreach my $name (keys %$leaf_symtab) { + undef *{$pkg . $name}; + } + + # delete the symbol table %$leaf_symtab = (); delete $stem_symtab->{$leaf}; diff --git a/mg.c b/mg.c index b1049c5..aee2790 100644 --- a/mg.c +++ b/mg.c @@ -614,6 +614,9 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) { i = t1 - s1; s = rx->subbeg + s1; + if (!rx->subbeg) + break; + getrx: if (i >= 0) { bool was_tainted; diff --git a/pod/Makefile.SH b/pod/Makefile.SH index 17ba91a..45f1856 100644 --- a/pod/Makefile.SH +++ b/pod/Makefile.SH @@ -45,6 +45,10 @@ HTML = $HTML TEX = $TEX +# The following is used to include the current directory in +# the dynamic loader path you are building a shared libperl. +LDLIBPTH = $ldlibpth + !GROK!THIS! ## In the following dollars and backticks do not need the extra backslash. @@ -68,7 +72,7 @@ converters: $(CONVERTERS) regen_pods: perlmodlib.pod toc -buildtoc: buildtoc.PL +buildtoc: buildtoc.PL perl.pod ../MANIFEST $(PERL) -I ../lib buildtoc.PL man: pod2man $(MAN) @@ -77,7 +81,7 @@ html: pod2html $(HTML) tex: pod2latex $(TEX) -toc: +toc: buildtoc $(PERL) -I../lib buildtoc .SUFFIXES: .pm .pod @@ -124,19 +128,19 @@ check: checkpods # Dependencies. pod2latex: pod2latex.PL ../lib/Config.pm - $(PERL) -I../lib pod2latex.PL + $(LDLIBPTH) $(PERL) -I../lib pod2latex.PL pod2html: pod2html.PL ../lib/Config.pm - $(PERL) -I ../lib pod2html.PL + $(LDLIBPTH) $(PERL) -I ../lib pod2html.PL pod2man: pod2man.PL ../lib/Config.pm - $(PERL) -I ../lib pod2man.PL + $(LDLIBPTH) $(PERL) -I ../lib pod2man.PL pod2text: pod2text.PL ../lib/Config.pm - $(PERL) -I ../lib pod2text.PL + $(LDLIBPTH) $(PERL) -I ../lib pod2text.PL checkpods: checkpods.PL ../lib/Config.pm - $(PERL) -I ../lib checkpods.PL + $(LDLIBPTH) $(PERL) -I ../lib checkpods.PL pod2usage: pod2usage.PL ../lib/Config.pm $(PERL) -I ../lib pod2usage.PL diff --git a/pod/buildtoc.PL b/pod/buildtoc.PL index 8e07ce8..54853d3 100644 --- a/pod/buildtoc.PL +++ b/pod/buildtoc.PL @@ -60,58 +60,59 @@ if (-d "pod") { } @pods = qw( - perl - perlfaq - perltoc - perlbook - - perlsyn - perldata - perlop - perlreftut - perldsc - perllol - perlrequick - perlretut - - perllexwarn - perldebug - - perlrun - perlfunc - perlopentut - perlvar - perlsub - perlmod - perlpod - - perlstyle - perlmodlib - perlmodinstall - perlnewmod - perltrap - perlport - perlsec - - perlref - perlre - perlform - perllocale - perlunicode - - perlboot - perltoot - perltootc - perlobj - perlbot - perltie - - perlipc - perlnumber - perlfork - perlthrtut - - perldiag + perl + perlfaq + perltoc + perlbook + + perlsyn + perldata + perlop + perlsub + perlfunc + perlreftut + perldsc + perlrequick + perlpod + perlstyle + perltrap + + perlrun + perldiag + perllexwarn + perldebug + + perlvar + perllol + perlopentut + perlretut + + perlref + perlre + perlform + perllocale + perlunicode + + perlipc + perlfork + perlnumber + perlthrtut + + perlport + perlsec + + perlboot + perltoot + perltootc + perlobj + perlbot + perltie + + perlmod + perlmodlib + perlmodinstall + perlnewmod + perlfaq1 perlfaq2 perlfaq3 @@ -152,6 +153,7 @@ if (-d "pod") { perlmachten perlos2 perlos390 + perlposix-bc perlvms perlwin32 ); @@ -164,6 +166,7 @@ if (-d "pod") { perlmachten perlos2 perlos390 + perlposix-bc perlvms perlwin32 ); @@ -186,7 +189,7 @@ close(MANI); open(PERLPOD, "perl.pod") || die "$0: opening perl.pod failed: $!\n"; while () { if (/^For ease of access, /../^\(If you're intending /) { - if (/^\s+(perl\w*)\s+\w/) { + if (/^\s+(perl\S*)\s+\w/) { push @PERLPODS, "$1.pod"; } } diff --git a/pod/perl.pod b/pod/perl.pod index ce0d1b4..0273dbf 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -22,30 +22,24 @@ For ease of access, the Perl manual has been split up into several sections: perlsyn Perl syntax perldata Perl data structures perlop Perl operators and precedence + perlsub Perl subroutines + perlfunc Perl builtin functions perlreftut Perl references short introduction perldsc Perl data structures intro - perllol Perl data structures: arrays of arrays perlrequick Perl regular expressions quick start - perlretut Perl regular expressions tutorial + perlpod Perl plain old documentation + perlstyle Perl style guide + perltrap Perl traps for the unwary + perlrun Perl execution and options + perldiag Perl diagnostic messages perllexwarn Perl warnings and their control perldebug Perl debugging - perlrun Perl execution and options - perlfunc Perl builtin functions - perlopentut Perl open() tutorial perlvar Perl predefined variables - perlsub Perl subroutines - perlmod Perl modules: how they work - perlpod Perl plain old documentation - - perlstyle Perl style guide - perlmodlib Perl modules: how to write and use - perlmodinstall Perl modules: how to install from CPAN - perlnewmod Perl modules: preparing a new module for distribution - perltrap Perl traps for the unwary - perlport Perl portability guide - perlsec Perl security + perllol Perl data structures: arrays of arrays + perlopentut Perl open() tutorial + perlretut Perl regular expressions tutorial perlref Perl references, the rest of the story perlre Perl regular expressions, the rest of the story @@ -53,6 +47,14 @@ For ease of access, the Perl manual has been split up into several sections: perllocale Perl locale support perlunicode Perl unicode support + perlipc Perl interprocess communication + perlfork Perl fork() information + perlnumber Perl number semantics + perlthrtut Perl threads tutorial + + perlport Perl portability guide + perlsec Perl security + perlboot Perl OO tutorial for beginners perltoot Perl OO tutorial, part 1 perltootc Perl OO tutorial, part 2 @@ -60,12 +62,11 @@ For ease of access, the Perl manual has been split up into several sections: perlbot Perl OO tricks and examples perltie Perl objects hidden behind simple variables - perlipc Perl interprocess communication - perlnumber Perl number semantics - perlfork Perl fork() information - perlthrtut Perl threads tutorial + perlmod Perl modules: how they work + perlmodlib Perl modules: how to write and use + perlmodinstall Perl modules: how to install from CPAN + perlnewmod Perl modules: preparing a new module for distribution - perldiag Perl diagnostic messages perlfaq1 General Questions About Perl perlfaq2 Obtaining and Learning about Perl perlfaq3 Programming Tools @@ -106,6 +107,7 @@ For ease of access, the Perl manual has been split up into several sections: perlmachten Perl notes for Power MachTen perlos2 Perl notes for OS/2 perlos390 Perl notes for OS/390 + perlposix-bc Perl notes for POSIX-BC perlvms Perl notes for VMS perlwin32 Perl notes for Windows diff --git a/pod/perldiag.pod b/pod/perldiag.pod index c034c36..a10f9df 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -76,6 +76,13 @@ on the operator (e.g. C) or by declaring the subroutine to be an object method (see L or L). +=item Ambiguous range in transliteration operator + +(F) You wrote something like C which doesn't mean anything at +all. To include a C<-> character in a transliteration, put it either +first or last. (In the past, C was synonymous with +C, which was probably not what you would have expected.) + =item Ambiguous use of %s resolved as %s (W ambiguous)(S) You said something that may not be interpreted the way @@ -1081,7 +1088,7 @@ arbitrarily. ("Simple" and "medium" situations are handled without recursion and are not subject to a limit.) Try shortening the string under examination; looping in Perl code (e.g. with C) rather than in the regular expression engine; or rewriting the regular expression so -that it is simpler or backtracks less. (See L for information +that it is simpler or backtracks less. (See L for information on I.) =item connect() on closed socket %s @@ -1697,6 +1704,11 @@ L. (F) The range specified in a character class had a minimum character greater than the maximum character. See L. +=item invalid [] range "%s" in transliteration operator + +(F) The range specified in the tr/// or y/// operator had a minimum +character greater than the maximum character. See L. + =item Invalid separator character %s in attribute list (F) Something other than a colon or whitespace was seen between the diff --git a/pod/perlfaq2.pod b/pod/perlfaq2.pod index af9178d..d0b92bb 100644 --- a/pod/perlfaq2.pod +++ b/pod/perlfaq2.pod @@ -196,15 +196,13 @@ Christiansen maintains a list of these books, some with extensive reviews, at http://www.perl.com/perl/critiques/index.html. The incontestably definitive reference book on Perl, written by -the creator of Perl, is now in its second edition: +the creator of Perl, is now (July 2000) in its third edition: Programming Perl (the "Camel Book"): - by Larry Wall, Tom Christiansen, and Randal Schwartz - ISBN 1-56592-149-6 (English) - ISBN 4-89052-384-7 (Japanese) - URL: http://www.oreilly.com/catalog/pperl2/ - (French, German, Italian, and Hungarian translations also - available) + by Larry Wall, Tom Christiansen, and Jon Orwant + 0-596-00027-8 [3rd edition July 2000] + http://www.oreilly.com/catalog/pperl3/ + (English, translations to several languages are also available) The companion volume to the Camel containing thousands of real-world examples, mini-tutorials, and complete programs @@ -212,9 +210,9 @@ of real-world examples, mini-tutorials, and complete programs The Perl Cookbook (the "Ram Book"): by Tom Christiansen and Nathan Torkington, - with Foreword by Larry Wall - ISBN: 1-56592-243-3 - URL: http://perl.oreilly.com/cookbook/ + with Foreword by Larry Wall + ISBN 1-56592-243-3 [1st Edition August 1998] + http://perl.oreilly.com/cookbook/ If you're already a hard-core systems programmer, then the Camel Book might suffice for you to learn Perl from. But if you're not, check @@ -223,8 +221,8 @@ out: Learning Perl (the "Llama Book"): by Randal Schwartz and Tom Christiansen with Foreword by Larry Wall - ISBN: 1-56592-284-0 - URL: http://www.oreilly.com/catalog/lperl2/ + ISBN 1-56592-284-0 [2nd Edition July 1997] + http://www.oreilly.com/catalog/lperl2/ Despite the picture at the URL above, the second edition of "Llama Book" really has a blue cover, and is updated for the 5.004 release @@ -245,66 +243,106 @@ See http://www.ora.com/ on the Web. What follows is a list of the books that the FAQ authors found personally useful. Your mileage may (but, we hope, probably won't) vary. -Recommended books on (or mostly on) Perl follow; those marked with -a star may be ordered from O'Reilly. +Recommended books on (or mostly on) Perl follow. =over =item References - *Programming Perl - by Larry Wall, Tom Christiansen, and Randal L. Schwartz + Programming Perl + by Larry Wall, Tom Christiansen, and Jon Orwant + ISBN 0-596-00027-8 [3rd edition July 2000] + http://www.oreilly.com/catalog/pperl3/ - *Perl 5 Desktop Reference + Perl 5 Pocket Reference by Johan Vromans + ISBN 0-596-00032-4 [3rd edition May 2000] + http://www.oreilly.com/catalog/perlpr3/ - *Perl in a Nutshell + Perl in a Nutshell by Ellen Siever, Stephan Spainhour, and Nathan Patwardhan + ISBN 1-56592-286-7 [1st edition December 1998] + http://www.oreilly.com/catalog/perlnut/ =item Tutorials - *Learning Perl [2nd edition] + Elements of Programming with Perl + by Andrew L. Johnson + ISBN 1884777805 [1st edition October 1999] + http://www.manning.com/Johnson/ + + Learning Perl by Randal L. Schwartz and Tom Christiansen with foreword by Larry Wall + ISBN 1-56592-284-0 [2nd edition July 1997] + http://www.oreilly.com/catalog/lperl2/ - *Learning Perl on Win32 Systems + Learning Perl on Win32 Systems by Randal L. Schwartz, Erik Olson, and Tom Christiansen, with foreword by Larry Wall + ISBN 1-56592-324-3 [1st edition August 1997] + http://www.oreilly.com/catalog/lperlwin/ Perl: The Programmer's Companion by Nigel Chapman + ISBN 0-471-97563-X [1st edition October 1997] + http://catalog.wiley.com/title.cgi?isbn=047197563X - Cross-Platform Perl - by Eric F. Johnson + Cross-Platform Perl + by Eric Foster-Johnson + ISBN 1-55851-483-X [2nd edition September 2000] + http://www.pconline.com/~erc/perlbook.htm - MacPerl: Power and Ease - by Vicki Brown and Chris Nandor, foreword by Matthias Neeracher + MacPerl: Power and Ease + by Vicki Brown and Chris Nandor, + with foreword by Matthias Neeracher + ISBN 1-881957-32-2 [1st edition May 1998] + http://www.macperl.com/ptf_book/ =item Task-Oriented - *The Perl Cookbook + The Perl Cookbook by Tom Christiansen and Nathan Torkington with foreword by Larry Wall + ISBN 1-56592-243-3 [1st edition August 1998] + http://www.oreilly.com/catalog/cookbook/ - Perl5 Interactive Course [2nd edition] + Perl5 Interactive Course by Jon Orwant + ISBN 1571690646 [1st edition June 1997] - *Advanced Perl Programming + Advanced Perl Programming by Sriram Srinivasan + ISBN 1-56592-220-4 [1st edition August 1997] + http://www.oreilly.com/catalog/advperl/ Effective Perl Programming by Joseph Hall + ISBN 0-201-41975-0 [1st edition 1998] + http://www.awl.com/ =item Special Topics - *Mastering Regular Expressions - by Jeffrey Friedl + Mastering Regular Expressions + by Jeffrey E. F. Friedl + ISBN 1-56592-257-3 [1st edition January 1997] + http://www.oreilly.com/catalog/regex/ - How to Set up and Maintain a World Wide Web Site [2nd edition] + How to Set up and Maintain a World Wide Web Site by Lincoln Stein + ISBN 0-201-63389-2 [1st edition 1995] + http://www.awl.com/ - *Learning Perl/Tk + Object Oriented Perl + Damian Conway + with foreword by Randal L. Schwartz + ISBN 1884777791 [1st edition August 1999] + http://www.manning.com/Conway/ + + Learning Perl/Tk by Nancy Walsh + ISBN 1-56592-314-6 [1st edition January 1999] + http://www.oreilly.com/catalog/lperltk/ =back @@ -331,14 +369,19 @@ http://www.stonehenge.com/merlyn/WebTechniques/. To get the best (and possibly cheapest) performance, pick a site from the list below and use it to grab the complete list of mirror sites. From there you can find the quickest site for you. Remember, the -following list is I the complete list of CPAN mirrors. - - http://www.perl.com/CPAN-local - http://www.perl.com/CPAN (redirects to an ftp mirror) - ftp://cpan.valueclick.com/pub/CPAN/ +following list is I the complete list of CPAN mirrors +(the complete list contains 136 sites as of July 2000): + + http://www.perl.com/CPAN/ + http://www.cpan.org/CPAN/ + http://download.sourceforge.net/mirrors/CPAN/ + ftp://ftp.digital.com/pub/plan/perl/CPAN/ + ftp://ftp.flirble.org/pub/languages/perl/CPAN/ + ftp://ftp.uvsq.fr/pub/perl/CPAN/ ftp://ftp.funet.fi/pub/languages/perl/CPAN/ - http://www.cs.ruu.nl/pub/PERL/CPAN/ - ftp://ftp.cs.colorado.edu/pub/perl/CPAN/ + ftp://ftp.dti.ad.jp/pub/lang/CPAN/ + ftp://mirror.aarnet.edu.au/pub/perl/CPAN/ + ftp://cpan.if.usp.br/pub/mirror/CPAN/ =head2 What mailing lists are there for Perl? diff --git a/pod/perlguts.pod b/pod/perlguts.pod index 5f1dd21..160850c 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -832,6 +832,8 @@ The current kinds of Magic Virtual Tables are: a vtbl_amagicelem %OVERLOAD hash element c (none) Holds overload table (AMT) on stash B vtbl_bm Boyer-Moore (fast string search) + D vtbl_regdata Regex match position data (@+ and @- vars) + d vtbl_regdatum Regex match position data element E vtbl_env %ENV hash e vtbl_envelem %ENV hash element f vtbl_fm Formline ('compiled' format) diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 2e23fc9..accb11c 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -488,6 +488,153 @@ regular expressions =back +=head2 perlsub - Perl subroutines + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=over + +=item Private Variables via my() + +=item Persistent Private Variables + +=item Temporary Values via local() + +=item Lvalue subroutines + +=item Passing Symbol Table Entries (typeglobs) + +=item When to Still Use local() + +1. You need to give a global variable a temporary value, especially $_, 2. +You need to create a local file or directory handle or a local function, 3. +You want to temporarily change just one element of an array or hash + +=item Pass by Reference + +=item Prototypes + +=item Constant Functions + +=item Overriding Built-in Functions + +=item Autoloading + +=item Subroutine Attributes + +=back + +=item SEE ALSO + +=back + +=head2 perlfunc - Perl builtin functions + +=over + +=item DESCRIPTION + +=over + +=item Perl Functions by Category + +Functions for SCALARs or strings, Regular expressions and pattern matching, +Numeric functions, Functions for real @ARRAYs, Functions for list data, +Functions for real %HASHes, Input and output functions, Functions for fixed +length data or records, Functions for filehandles, files, or directories, +Keywords related to the control flow of your perl program, Keywords related +to scoping, Miscellaneous functions, Functions for processes and process +groups, Keywords related to perl modules, Keywords related to classes and +object-orientedness, Low-level socket functions, System V interprocess +communication functions, Fetching user and group info, Fetching network +info, Time-related functions, Functions new in perl5, Functions obsoleted +in perl5 + +=item Portability + +=item Alphabetical Listing of Perl Functions + +I<-X> FILEHANDLE, I<-X> EXPR, I<-X>, abs VALUE, abs, accept +NEWSOCKET,GENERICSOCKET, alarm SECONDS, alarm, atan2 Y,X, bind SOCKET,NAME, +binmode FILEHANDLE, DISCIPLINE, binmode FILEHANDLE, bless REF,CLASSNAME, +bless REF, caller EXPR, caller, chdir EXPR, chmod LIST, chomp VARIABLE, +chomp LIST, chomp, chop VARIABLE, chop LIST, chop, chown LIST, chr NUMBER, +chr, chroot FILENAME, chroot, close FILEHANDLE, close, closedir DIRHANDLE, +connect SOCKET,NAME, continue BLOCK, cos EXPR, crypt PLAINTEXT,SALT, +dbmclose HASH, dbmopen HASH,DBNAME,MASK, defined EXPR, defined, delete +EXPR, die LIST, do BLOCK, do SUBROUTINE(LIST), do EXPR, dump LABEL, dump, +each HASH, eof FILEHANDLE, eof (), eof, eval EXPR, eval BLOCK, exec LIST, +exec PROGRAM LIST, exists EXPR, exit EXPR, exp EXPR, exp, fcntl +FILEHANDLE,FUNCTION,SCALAR, fileno FILEHANDLE, flock FILEHANDLE,OPERATION, +fork, format, formline PICTURE,LIST, getc FILEHANDLE, getc, getlogin, +getpeername SOCKET, getpgrp PID, getppid, getpriority WHICH,WHO, getpwnam +NAME, getgrnam NAME, gethostbyname NAME, getnetbyname NAME, getprotobyname +NAME, getpwuid UID, getgrgid GID, getservbyname NAME,PROTO, gethostbyaddr +ADDR,ADDRTYPE, getnetbyaddr ADDR,ADDRTYPE, getprotobynumber NUMBER, +getservbyport PORT,PROTO, getpwent, getgrent, gethostent, getnetent, +getprotoent, getservent, setpwent, setgrent, sethostent STAYOPEN, setnetent +STAYOPEN, setprotoent STAYOPEN, setservent STAYOPEN, endpwent, endgrent, +endhostent, endnetent, endprotoent, endservent, getsockname SOCKET, +getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR, glob, gmtime EXPR, goto LABEL, +goto EXPR, goto &NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, +import, index STR,SUBSTR,POSITION, index STR,SUBSTR, int EXPR, int, ioctl +FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys HASH, kill SIGNAL, LIST, +last LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, +link OLDFILE,NEWFILE, listen SOCKET,QUEUESIZE, local EXPR, localtime EXPR, +lock, log EXPR, log, lstat FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK +LIST, map EXPR,LIST, mkdir FILENAME,MASK, mkdir FILENAME, msgctl +ID,CMD,ARG, msgget KEY,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, msgsnd +ID,MSG,FLAGS, my EXPR, my EXPR : ATTRIBUTES, next LABEL, next, no Module +LIST, oct EXPR, oct, open FILEHANDLE,MODE,LIST, open FILEHANDLE,EXPR, open +FILEHANDLE, opendir DIRHANDLE,EXPR, ord EXPR, ord, our EXPR, pack +TEMPLATE,LIST, package, package NAMESPACE, pipe READHANDLE,WRITEHANDLE, pop +ARRAY, pop, pos SCALAR, pos, print FILEHANDLE LIST, print LIST, print, +printf FILEHANDLE FORMAT, LIST, printf FORMAT, LIST, prototype FUNCTION, +push ARRAY,LIST, q/STRING/, qq/STRING/, qr/STRING/, qx/STRING/, qw/STRING/, +quotemeta EXPR, quotemeta, rand EXPR, rand, read +FILEHANDLE,SCALAR,LENGTH,OFFSET, read FILEHANDLE,SCALAR,LENGTH, readdir +DIRHANDLE, readline EXPR, readlink EXPR, readlink, readpipe EXPR, recv +SOCKET,SCALAR,LENGTH,FLAGS, redo LABEL, redo, ref EXPR, ref, rename +OLDNAME,NEWNAME, require VERSION, require EXPR, require, reset EXPR, reset, +return EXPR, return, reverse LIST, rewinddir DIRHANDLE, rindex +STR,SUBSTR,POSITION, rindex STR,SUBSTR, rmdir FILENAME, rmdir, s///, scalar +EXPR, seek FILEHANDLE,POSITION,WHENCE, seekdir DIRHANDLE,POS, select +FILEHANDLE, select, select RBITS,WBITS,EBITS,TIMEOUT, semctl +ID,SEMNUM,CMD,ARG, semget KEY,NSEMS,FLAGS, semop KEY,OPSTRING, send +SOCKET,MSG,FLAGS,TO, send SOCKET,MSG,FLAGS, setpgrp PID,PGRP, setpriority +WHICH,WHO,PRIORITY, setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL, shift ARRAY, +shift, shmctl ID,CMD,ARG, shmget KEY,SIZE,FLAGS, shmread ID,VAR,POS,SIZE, +shmwrite ID,STRING,POS,SIZE, shutdown SOCKET,HOW, sin EXPR, sin, sleep +EXPR, sleep, socket SOCKET,DOMAIN,TYPE,PROTOCOL, socketpair +SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL, sort SUBNAME LIST, sort BLOCK LIST, +sort LIST, splice ARRAY,OFFSET,LENGTH,LIST, splice ARRAY,OFFSET,LENGTH, +splice ARRAY,OFFSET, splice ARRAY, split /PATTERN/,EXPR,LIMIT, split +/PATTERN/,EXPR, split /PATTERN/, split, sprintf FORMAT, LIST, sqrt EXPR, +sqrt, srand EXPR, srand, stat FILEHANDLE, stat EXPR, stat, study SCALAR, +study, sub BLOCK, sub NAME, sub NAME BLOCK, substr +EXPR,OFFSET,LENGTH,REPLACEMENT, substr EXPR,OFFSET,LENGTH, substr +EXPR,OFFSET, symlink OLDFILE,NEWFILE, syscall LIST, sysopen +FILEHANDLE,FILENAME,MODE, sysopen FILEHANDLE,FILENAME,MODE,PERMS, sysread +FILEHANDLE,SCALAR,LENGTH,OFFSET, sysread FILEHANDLE,SCALAR,LENGTH, sysseek +FILEHANDLE,POSITION,WHENCE, system LIST, system PROGRAM LIST, syswrite +FILEHANDLE,SCALAR,LENGTH,OFFSET, syswrite FILEHANDLE,SCALAR,LENGTH, +syswrite FILEHANDLE,SCALAR, tell FILEHANDLE, tell, telldir DIRHANDLE, tie +VARIABLE,CLASSNAME,LIST, tied VARIABLE, time, times, tr///, truncate +FILEHANDLE,LENGTH, truncate EXPR,LENGTH, uc EXPR, uc, ucfirst EXPR, +ucfirst, umask EXPR, umask, undef EXPR, undef, unlink LIST, unlink, unpack +TEMPLATE,EXPR, untie VARIABLE, unshift ARRAY,LIST, use Module VERSION LIST, +use Module VERSION, use Module LIST, use Module, use VERSION, utime LIST, +values HASH, vec EXPR,OFFSET,BITS, wait, waitpid PID,FLAGS, wantarray, warn +LIST, write FILEHANDLE, write EXPR, write, y/// + +=back + +=back + =head2 perlreftut - Mark's very short tutorial about references =over @@ -617,26 +764,6 @@ more elaborate constructs =back -=head2 perllol - Manipulating Arrays of Arrays in Perl - -=over - -=item DESCRIPTION - -=item Declaration and Access of Arrays of Arrays - -=item Growing Your Own - -=item Access and Printing - -=item Slices - -=item SEE ALSO - -=item AUTHOR - -=back - =head2 perlrequick - Perl regular expressions quick start =over @@ -694,144 +821,169 @@ times =back -=head2 perlretut - Perl regular expressions tutorial +=head2 perlpod - plain old documentation =over =item DESCRIPTION -=item Part 1: The basics - =over -=item Simple word matching +=item Verbatim Paragraph -=item Using character classes +=item Command Paragraph -\d is a digit and represents [0-9], \s is a whitespace character and -represents [\ \t\r\n\f], \w is a word character (alphanumeric or _) and -represents [0-9a-zA-Z_], \D is a negated \d; it represents any character -but a digit [^0-9], \S is a negated \s; it represents any non-whitespace -character [^\s], \W is a negated \w; it represents any non-word character -[^\w], The period '.' matches any character but "\n", no modifiers (//): -Default behavior. C<'.'> matches any character except C<"\n">. C<^> -matches only at the beginning of the string and C<$> matches only at the -end or before a newline at the end, s modifier (//s): Treat string as a -single long line. C<'.'> matches any character, even C<"\n">. C<^> -matches only at the beginning of the string and C<$> matches only at the -end or before a newline at the end, m modifier (//m): Treat string as a set -of multiple lines. C<'.'> matches any character except C<"\n">. C<^> and -C<$> are able to match at the start or end of I line within the -string, both s and m modifiers (//sm): Treat string as a single long line, -but detect multiple lines. C<'.'> matches any character, even C<"\n">. -C<^> and C<$>, however, are able to match at the start or end of I -line within the string +=item Ordinary Block of Text -=item Matching this or that +=item The Intent -=item Grouping things and hierarchical matching +=item Embedding Pods in Perl Modules -0 Start with the first letter in the string 'a', 1 Try the first -alternative in the first group 'abd', 2 Match 'a' followed by 'b'. So far -so good, 3 'd' in the regexp doesn't match 'c' in the string - a dead end. -So backtrack two characters and pick the second alternative in the first -group 'abc', 4 Match 'a' followed by 'b' followed by 'c'. We are on a roll -and have satisfied the first group. Set $1 to 'abc', 5 Move on to the -second group and pick the first alternative 'df', 6 Match the 'd', 7 'f' in -the regexp doesn't match 'e' in the string, so a dead end. Backtrack one -character and pick the second alternative in the second group 'd', 8 'd' -matches. The second grouping is satisfied, so set $2 to 'd', 9 We are at -the end of the regexp, so we are done! We have matched 'abcd' out of the -string "abcde" +=item Common Pod Pitfalls -=item Extracting matches +=back -=item Matching repetitions +=item SEE ALSO -C = match 'a' 1 or 0 times, C = match 'a' 0 or more times, i.e., -any number of times, C = match 'a' 1 or more times, i.e., at least -once, C = match at least C times, but not more than C times, -C = match at least C or more times, C = match exactly C -times, Principle 0: Taken as a whole, any regexp will be matched at the -earliest possible position in the string, Principle 1: In an alternation -C, the leftmost alternative that allows a match for the whole -regexp will be the one used, Principle 2: The maximal matching quantifiers -C, C<*>, C<+> and C<{n,m}> will in general match as much of the string -as possible while still allowing the whole regexp to match, Principle 3: If -there are two or more elements in a regexp, the leftmost greedy quantifier, -if any, will match as much of the string as possible while still allowing -the whole regexp to match. The next leftmost greedy quantifier, if any, -will try to match as much of the string remaining available to it as -possible, while still allowing the whole regexp to match. And so on, until -all the regexp elements are satisfied, C = match 'a' 0 or 1 times. Try -0 first, then 1, C = match 'a' 0 or more times, i.e., any number of -times, but as few times as possible, C = match 'a' 1 or more times, -i.e., at least once, but as few times as possible, C = match at -least C times, not more than C times, as few times as possible, -C = match at least C times, but as few times as possible, -C = match exactly C times. Because we match exactly C times, -C is equivalent to C and is just there for notational -consistency, Principle 3: If there are two or more elements in a regexp, -the leftmost greedy (non-greedy) quantifier, if any, will match as much -(little) of the string as possible while still allowing the whole regexp to -match. The next leftmost greedy (non-greedy) quantifier, if any, will try -to match as much (little) of the string remaining available to it as -possible, while still allowing the whole regexp to match. And so on, until -all the regexp elements are satisfied, 0 Start with the first letter in the -string 't', 1 The first quantifier '.*' starts out by matching the whole -string 'the cat in the hat', 2 'a' in the regexp element 'at' doesn't match -the end of the string. Backtrack one character, 3 'a' in the regexp -element 'at' still doesn't match the last letter of the string 't', so -backtrack one more character, 4 Now we can match the 'a' and the 't', 5 -Move on to the third element '.*'. Since we are at the end of the string -and '.*' can match 0 times, assign it the empty string, 6 We are done! +=item AUTHOR -=item Building a regexp +=back -specifying the task in detail,, breaking down the problem into smaller -parts,, translating the small parts into regexps,, combining the regexps,, -and optimizing the final combined regexp +=head2 perlstyle - Perl style guide -=item Using regular expressions in Perl +=over + +=item DESCRIPTION =back -=item Part 2: Power tools +=head2 perltrap - Perl traps for the unwary =over -=item More on characters, strings, and character classes +=item DESCRIPTION -=item Compiling and saving regular expressions +=over -=item Embedding comments and modifiers in a regular expression +=item Awk Traps -=item Non-capturing groupings +=item C Traps -=item Looking ahead and looking behind +=item Sed Traps -=item Using independent subexpressions to prevent backtracking +=item Shell Traps -=item Conditional expressions +=item Perl Traps -=item A bit of magic: executing Perl code in a regular expression +=item Perl4 to Perl5 Traps -=item Pragmas and debugging +Discontinuance, Deprecation, and BugFix traps, Parsing Traps, Numerical +Traps, General data type traps, Context Traps - scalar, list contexts, +Precedence Traps, General Regular Expression Traps using s///, etc, +Subroutine, Signal, Sorting Traps, OS Traps, DBM Traps, Unclassified Traps + +=item Discontinuance, Deprecation, and BugFix traps + +Discontinuance, Deprecation, BugFix, Discontinuance, Discontinuance, +Discontinuance, BugFix, Discontinuance, Discontinuance, BugFix, +Discontinuance, Deprecation, Discontinuance, Discontinuance + +=item Parsing Traps + +Parsing, Parsing, Parsing, Parsing + +=item Numerical Traps + +Numerical, Numerical, Numerical, Bitwise string ops + +=item General data type traps + +(Arrays), (Arrays), (Hashes), (Globs), (Globs), (Scalar String), +(Constants), (Scalars), (Variable Suicide) + +=item Context Traps - scalar, list contexts + +(list context), (scalar context), (scalar context), (list, builtin) + +=item Precedence Traps + +Precedence, Precedence, Precedence, Precedence, Precedence, Precedence, +Precedence + +=item General Regular Expression Traps using s///, etc. + +Regular Expression, Regular Expression, Regular Expression, Regular +Expression, Regular Expression, Regular Expression, Regular Expression, +Regular Expression + +=item Subroutine, Signal, Sorting Traps + +(Signals), (Sort Subroutine), warn() won't let you specify a filehandle + +=item OS Traps + +(SysV), (SysV) + +=item Interpolation Traps + +Interpolation, Interpolation, Interpolation, Interpolation, Interpolation, +Interpolation, Interpolation, Interpolation, Interpolation + +=item DBM Traps + +DBM, DBM + +=item Unclassified Traps + +C/C trap using returned value, C on empty string with +LIMIT specified =back -=item BUGS +=back -=item SEE ALSO +=head2 perlrun - how to execute the Perl interpreter -=item AUTHOR AND COPYRIGHT +=over + +=item SYNOPSIS + +=item DESCRIPTION =over -=item Acknowledgments +=item #! and quoting on non-Unix systems + +OS/2, MS-DOS, Win95/NT, Macintosh, VMS + +=item Location of Perl + +=item Command Switches + +B<-0>[I], B<-a>, B<-C>, B<-c>, B<-d>, B<-d:>I, +B<-D>I, B<-D>I, B<-e> I, B<-F>I, +B<-h>, B<-i>[I], B<-I>I, B<-l>[I], +B<-m>[B<->]I, B<-M>[B<->]I, B<-M>[B<->]I<'module ...'>, +B<-[mM]>[B<->]I, B<-n>, B<-p>, B<-P>, B<-s>, B<-S>, +B<-T>, B<-u>, B<-U>, B<-v>, B<-V>, B<-V:>I, B<-w>, B<-W>, B<-X>, +B<-x> I =back +=item ENVIRONMENT + +HOME, LOGDIR, PATH, PERL5LIB, PERL5OPT, PERLLIB, PERL5DB, PERL5SHELL +(specific to the Win32 port), PERL_DEBUG_MSTATS, PERL_DESTRUCT_LEVEL, +PERL_ROOT (specific to the VMS port), SYS$LOGIN (specific to the VMS port) + +=back + +=head2 perldiag - various Perl diagnostics + +=over + +=item DESCRIPTION + =back =head2 perllexwarn - Perl Lexical Warnings @@ -926,162 +1078,93 @@ listing =back -=head2 perlrun - how to execute the Perl interpreter +=head2 perlvar - Perl predefined variables =over -=item SYNOPSIS - =item DESCRIPTION =over -=item #! and quoting on non-Unix systems +=item Predefined Names -OS/2, MS-DOS, Win95/NT, Macintosh, VMS +$ARG, $_, $>, $MATCH, $&, $PREMATCH, $`, $POSTMATCH, $', +$LAST_PAREN_MATCH, $+, @LAST_MATCH_END, @+, $MULTILINE_MATCHING, $*, +input_line_number HANDLE EXPR, $INPUT_LINE_NUMBER, $NR, $, +input_record_separator HANDLE EXPR, $INPUT_RECORD_SEPARATOR, $RS, $/, +autoflush HANDLE EXPR, $OUTPUT_AUTOFLUSH, $|, output_field_separator HANDLE +EXPR, $OUTPUT_FIELD_SEPARATOR, $OFS, $,, output_record_separator HANDLE +EXPR, $OUTPUT_RECORD_SEPARATOR, $ORS, $\, $LIST_SEPARATOR, $", +$SUBSCRIPT_SEPARATOR, $SUBSEP, $;, $OFMT, $#, format_page_number HANDLE +EXPR, $FORMAT_PAGE_NUMBER, $%, format_lines_per_page HANDLE EXPR, +$FORMAT_LINES_PER_PAGE, $=, format_lines_left HANDLE EXPR, +$FORMAT_LINES_LEFT, $-, @LAST_MATCH_START, @-, C<$`> is the same as +C, C<$&> is the same as C, C<$'> is the same as C, C<$1> is the same +as C, C<$2> is the same as +C, C<$3> is the same as C, format_name HANDLE EXPR, $FORMAT_NAME, $~, +format_top_name HANDLE EXPR, $FORMAT_TOP_NAME, $^, +format_line_break_characters HANDLE EXPR, $FORMAT_LINE_BREAK_CHARACTERS, +$:, format_formfeed HANDLE EXPR, $FORMAT_FORMFEED, $^L, $ACCUMULATOR, $^A, +$CHILD_ERROR, $?, $OS_ERROR, $ERRNO, $!, $EXTENDED_OS_ERROR, $^E, +$EVAL_ERROR, $@, $PROCESS_ID, $PID, $$, $REAL_USER_ID, $UID, $<, +$EFFECTIVE_USER_ID, $EUID, $>, $REAL_GROUP_ID, $GID, $(, +$EFFECTIVE_GROUP_ID, $EGID, $), $PROGRAM_NAME, $0, $[, $], $COMPILING, $^C, +$DEBUGGING, $^D, $SYSTEM_FD_MAX, $^F, $^H, %^H, $INPLACE_EDIT, $^I, $^M, +$OSNAME, $^O, $PERLDB, $^P, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, +0x100, 0x200, $LAST_REGEXP_CODE_RESULT, $^R, $EXCEPTIONS_BEING_CAUGHT, $^S, +$BASETIME, $^T, $PERL_VERSION, $^V, $WARNING, $^W, ${^WARNING_BITS}, +${^WIDE_SYSTEM_CALLS}, $EXECUTABLE_NAME, $^X, $ARGV, @ARGV, @INC, @_, %INC, +%ENV, $ENV{expr}, %SIG, $SIG{expr} -=item Location of Perl +=item Error Indicators -=item Command Switches +=item Technical Note on the Syntax of Variable Names -B<-0>[I], B<-a>, B<-C>, B<-c>, B<-d>, B<-d:>I, -B<-D>I, B<-D>I, B<-e> I, B<-F>I, -B<-h>, B<-i>[I], B<-I>I, B<-l>[I], -B<-m>[B<->]I, B<-M>[B<->]I, B<-M>[B<->]I<'module ...'>, -B<-[mM]>[B<->]I, B<-n>, B<-p>, B<-P>, B<-s>, B<-S>, -B<-T>, B<-u>, B<-U>, B<-v>, B<-V>, B<-V:>I, B<-w>, B<-W>, B<-X>, -B<-x> I +=back + +=item BUGS =back -=item ENVIRONMENT +=head2 perllol - Manipulating Arrays of Arrays in Perl -HOME, LOGDIR, PATH, PERL5LIB, PERL5OPT, PERLLIB, PERL5DB, PERL5SHELL -(specific to the Win32 port), PERL_DEBUG_MSTATS, PERL_DESTRUCT_LEVEL, -PERL_ROOT (specific to the VMS port), SYS$LOGIN (specific to the VMS port) +=over + +=item DESCRIPTION + +=item Declaration and Access of Arrays of Arrays + +=item Growing Your Own + +=item Access and Printing + +=item Slices + +=item SEE ALSO + +=item AUTHOR =back -=head2 perlfunc - Perl builtin functions +=head2 perlopentut - tutorial on opening things in Perl =over =item DESCRIPTION +=item Open E la shell + =over -=item Perl Functions by Category +=item Simple Opens -Functions for SCALARs or strings, Regular expressions and pattern matching, -Numeric functions, Functions for real @ARRAYs, Functions for list data, -Functions for real %HASHes, Input and output functions, Functions for fixed -length data or records, Functions for filehandles, files, or directories, -Keywords related to the control flow of your perl program, Keywords related -to scoping, Miscellaneous functions, Functions for processes and process -groups, Keywords related to perl modules, Keywords related to classes and -object-orientedness, Low-level socket functions, System V interprocess -communication functions, Fetching user and group info, Fetching network -info, Time-related functions, Functions new in perl5, Functions obsoleted -in perl5 +=item Pipe Opens -=item Portability +=item The Minus File -=item Alphabetical Listing of Perl Functions - -I<-X> FILEHANDLE, I<-X> EXPR, I<-X>, abs VALUE, abs, accept -NEWSOCKET,GENERICSOCKET, alarm SECONDS, alarm, atan2 Y,X, bind SOCKET,NAME, -binmode FILEHANDLE, DISCIPLINE, binmode FILEHANDLE, bless REF,CLASSNAME, -bless REF, caller EXPR, caller, chdir EXPR, chmod LIST, chomp VARIABLE, -chomp LIST, chomp, chop VARIABLE, chop LIST, chop, chown LIST, chr NUMBER, -chr, chroot FILENAME, chroot, close FILEHANDLE, close, closedir DIRHANDLE, -connect SOCKET,NAME, continue BLOCK, cos EXPR, crypt PLAINTEXT,SALT, -dbmclose HASH, dbmopen HASH,DBNAME,MASK, defined EXPR, defined, delete -EXPR, die LIST, do BLOCK, do SUBROUTINE(LIST), do EXPR, dump LABEL, dump, -each HASH, eof FILEHANDLE, eof (), eof, eval EXPR, eval BLOCK, exec LIST, -exec PROGRAM LIST, exists EXPR, exit EXPR, exp EXPR, exp, fcntl -FILEHANDLE,FUNCTION,SCALAR, fileno FILEHANDLE, flock FILEHANDLE,OPERATION, -fork, format, formline PICTURE,LIST, getc FILEHANDLE, getc, getlogin, -getpeername SOCKET, getpgrp PID, getppid, getpriority WHICH,WHO, getpwnam -NAME, getgrnam NAME, gethostbyname NAME, getnetbyname NAME, getprotobyname -NAME, getpwuid UID, getgrgid GID, getservbyname NAME,PROTO, gethostbyaddr -ADDR,ADDRTYPE, getnetbyaddr ADDR,ADDRTYPE, getprotobynumber NUMBER, -getservbyport PORT,PROTO, getpwent, getgrent, gethostent, getnetent, -getprotoent, getservent, setpwent, setgrent, sethostent STAYOPEN, setnetent -STAYOPEN, setprotoent STAYOPEN, setservent STAYOPEN, endpwent, endgrent, -endhostent, endnetent, endprotoent, endservent, getsockname SOCKET, -getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR, glob, gmtime EXPR, goto LABEL, -goto EXPR, goto &NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, -import, index STR,SUBSTR,POSITION, index STR,SUBSTR, int EXPR, int, ioctl -FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys HASH, kill SIGNAL, LIST, -last LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, -link OLDFILE,NEWFILE, listen SOCKET,QUEUESIZE, local EXPR, localtime EXPR, -lock, log EXPR, log, lstat FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK -LIST, map EXPR,LIST, mkdir FILENAME,MASK, mkdir FILENAME, msgctl -ID,CMD,ARG, msgget KEY,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, msgsnd -ID,MSG,FLAGS, my EXPR, my EXPR : ATTRIBUTES, next LABEL, next, no Module -LIST, oct EXPR, oct, open FILEHANDLE,MODE,LIST, open FILEHANDLE,EXPR, open -FILEHANDLE, opendir DIRHANDLE,EXPR, ord EXPR, ord, our EXPR, pack -TEMPLATE,LIST, package, package NAMESPACE, pipe READHANDLE,WRITEHANDLE, pop -ARRAY, pop, pos SCALAR, pos, print FILEHANDLE LIST, print LIST, print, -printf FILEHANDLE FORMAT, LIST, printf FORMAT, LIST, prototype FUNCTION, -push ARRAY,LIST, q/STRING/, qq/STRING/, qr/STRING/, qx/STRING/, qw/STRING/, -quotemeta EXPR, quotemeta, rand EXPR, rand, read -FILEHANDLE,SCALAR,LENGTH,OFFSET, read FILEHANDLE,SCALAR,LENGTH, readdir -DIRHANDLE, readline EXPR, readlink EXPR, readlink, readpipe EXPR, recv -SOCKET,SCALAR,LENGTH,FLAGS, redo LABEL, redo, ref EXPR, ref, rename -OLDNAME,NEWNAME, require VERSION, require EXPR, require, reset EXPR, reset, -return EXPR, return, reverse LIST, rewinddir DIRHANDLE, rindex -STR,SUBSTR,POSITION, rindex STR,SUBSTR, rmdir FILENAME, rmdir, s///, scalar -EXPR, seek FILEHANDLE,POSITION,WHENCE, seekdir DIRHANDLE,POS, select -FILEHANDLE, select, select RBITS,WBITS,EBITS,TIMEOUT, semctl -ID,SEMNUM,CMD,ARG, semget KEY,NSEMS,FLAGS, semop KEY,OPSTRING, send -SOCKET,MSG,FLAGS,TO, send SOCKET,MSG,FLAGS, setpgrp PID,PGRP, setpriority -WHICH,WHO,PRIORITY, setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL, shift ARRAY, -shift, shmctl ID,CMD,ARG, shmget KEY,SIZE,FLAGS, shmread ID,VAR,POS,SIZE, -shmwrite ID,STRING,POS,SIZE, shutdown SOCKET,HOW, sin EXPR, sin, sleep -EXPR, sleep, socket SOCKET,DOMAIN,TYPE,PROTOCOL, socketpair -SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL, sort SUBNAME LIST, sort BLOCK LIST, -sort LIST, splice ARRAY,OFFSET,LENGTH,LIST, splice ARRAY,OFFSET,LENGTH, -splice ARRAY,OFFSET, splice ARRAY, split /PATTERN/,EXPR,LIMIT, split -/PATTERN/,EXPR, split /PATTERN/, split, sprintf FORMAT, LIST, sqrt EXPR, -sqrt, srand EXPR, srand, stat FILEHANDLE, stat EXPR, stat, study SCALAR, -study, sub BLOCK, sub NAME, sub NAME BLOCK, substr -EXPR,OFFSET,LENGTH,REPLACEMENT, substr EXPR,OFFSET,LENGTH, substr -EXPR,OFFSET, symlink OLDFILE,NEWFILE, syscall LIST, sysopen -FILEHANDLE,FILENAME,MODE, sysopen FILEHANDLE,FILENAME,MODE,PERMS, sysread -FILEHANDLE,SCALAR,LENGTH,OFFSET, sysread FILEHANDLE,SCALAR,LENGTH, sysseek -FILEHANDLE,POSITION,WHENCE, system LIST, system PROGRAM LIST, syswrite -FILEHANDLE,SCALAR,LENGTH,OFFSET, syswrite FILEHANDLE,SCALAR,LENGTH, -syswrite FILEHANDLE,SCALAR, tell FILEHANDLE, tell, telldir DIRHANDLE, tie -VARIABLE,CLASSNAME,LIST, tied VARIABLE, time, times, tr///, truncate -FILEHANDLE,LENGTH, truncate EXPR,LENGTH, uc EXPR, uc, ucfirst EXPR, -ucfirst, umask EXPR, umask, undef EXPR, undef, unlink LIST, unlink, unpack -TEMPLATE,EXPR, untie VARIABLE, unshift ARRAY,LIST, use Module VERSION LIST, -use Module VERSION, use Module LIST, use Module, use VERSION, utime LIST, -values HASH, vec EXPR,OFFSET,BITS, wait, waitpid PID,FLAGS, wantarray, warn -LIST, write FILEHANDLE, write EXPR, write, y/// - -=back - -=back - -=head2 perlopentut - tutorial on opening things in Perl - -=over - -=item DESCRIPTION - -=item Open E la shell - -=over - -=item Simple Opens - -=item Pipe Opens - -=item The Minus File - -=item Mixing Reads and Writes +=item Mixing Reads and Writes =item Filters @@ -1131,761 +1214,758 @@ LIST, write FILEHANDLE, write EXPR, write, y/// =back -=head2 perlvar - Perl predefined variables +=head2 perlretut - Perl regular expressions tutorial =over =item DESCRIPTION -=over - -=item Predefined Names - -$ARG, $_, $>, $MATCH, $&, $PREMATCH, $`, $POSTMATCH, $', -$LAST_PAREN_MATCH, $+, @LAST_MATCH_END, @+, $MULTILINE_MATCHING, $*, -input_line_number HANDLE EXPR, $INPUT_LINE_NUMBER, $NR, $, -input_record_separator HANDLE EXPR, $INPUT_RECORD_SEPARATOR, $RS, $/, -autoflush HANDLE EXPR, $OUTPUT_AUTOFLUSH, $|, output_field_separator HANDLE -EXPR, $OUTPUT_FIELD_SEPARATOR, $OFS, $,, output_record_separator HANDLE -EXPR, $OUTPUT_RECORD_SEPARATOR, $ORS, $\, $LIST_SEPARATOR, $", -$SUBSCRIPT_SEPARATOR, $SUBSEP, $;, $OFMT, $#, format_page_number HANDLE -EXPR, $FORMAT_PAGE_NUMBER, $%, format_lines_per_page HANDLE EXPR, -$FORMAT_LINES_PER_PAGE, $=, format_lines_left HANDLE EXPR, -$FORMAT_LINES_LEFT, $-, @LAST_MATCH_START, @-, C<$`> is the same as -C, C<$&> is the same as C, C<$'> is the same as C, C<$1> is the same -as C, C<$2> is the same as -C, C<$3> is the same as C, format_name HANDLE EXPR, $FORMAT_NAME, $~, -format_top_name HANDLE EXPR, $FORMAT_TOP_NAME, $^, -format_line_break_characters HANDLE EXPR, $FORMAT_LINE_BREAK_CHARACTERS, -$:, format_formfeed HANDLE EXPR, $FORMAT_FORMFEED, $^L, $ACCUMULATOR, $^A, -$CHILD_ERROR, $?, $OS_ERROR, $ERRNO, $!, $EXTENDED_OS_ERROR, $^E, -$EVAL_ERROR, $@, $PROCESS_ID, $PID, $$, $REAL_USER_ID, $UID, $<, -$EFFECTIVE_USER_ID, $EUID, $>, $REAL_GROUP_ID, $GID, $(, -$EFFECTIVE_GROUP_ID, $EGID, $), $PROGRAM_NAME, $0, $[, $], $COMPILING, $^C, -$DEBUGGING, $^D, $SYSTEM_FD_MAX, $^F, $^H, %^H, $INPLACE_EDIT, $^I, $^M, -$OSNAME, $^O, $PERLDB, $^P, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, -0x100, 0x200, $LAST_REGEXP_CODE_RESULT, $^R, $EXCEPTIONS_BEING_CAUGHT, $^S, -$BASETIME, $^T, $PERL_VERSION, $^V, $WARNING, $^W, ${^WARNING_BITS}, -${^WIDE_SYSTEM_CALLS}, $EXECUTABLE_NAME, $^X, $ARGV, @ARGV, @INC, @_, %INC, -%ENV, $ENV{expr}, %SIG, $SIG{expr} +=item Part 1: The basics -=item Error Indicators +=over -=item Technical Note on the Syntax of Variable Names +=item Simple word matching -=back +=item Using character classes -=item BUGS +\d is a digit and represents [0-9], \s is a whitespace character and +represents [\ \t\r\n\f], \w is a word character (alphanumeric or _) and +represents [0-9a-zA-Z_], \D is a negated \d; it represents any character +but a digit [^0-9], \S is a negated \s; it represents any non-whitespace +character [^\s], \W is a negated \w; it represents any non-word character +[^\w], The period '.' matches any character but "\n", no modifiers (//): +Default behavior. C<'.'> matches any character except C<"\n">. C<^> +matches only at the beginning of the string and C<$> matches only at the +end or before a newline at the end, s modifier (//s): Treat string as a +single long line. C<'.'> matches any character, even C<"\n">. C<^> +matches only at the beginning of the string and C<$> matches only at the +end or before a newline at the end, m modifier (//m): Treat string as a set +of multiple lines. C<'.'> matches any character except C<"\n">. C<^> and +C<$> are able to match at the start or end of I line within the +string, both s and m modifiers (//sm): Treat string as a single long line, +but detect multiple lines. C<'.'> matches any character, even C<"\n">. +C<^> and C<$>, however, are able to match at the start or end of I +line within the string -=back +=item Matching this or that -=head2 perlsub - Perl subroutines +=item Grouping things and hierarchical matching -=over +0 Start with the first letter in the string 'a', 1 Try the first +alternative in the first group 'abd', 2 Match 'a' followed by 'b'. So far +so good, 3 'd' in the regexp doesn't match 'c' in the string - a dead end. +So backtrack two characters and pick the second alternative in the first +group 'abc', 4 Match 'a' followed by 'b' followed by 'c'. We are on a roll +and have satisfied the first group. Set $1 to 'abc', 5 Move on to the +second group and pick the first alternative 'df', 6 Match the 'd', 7 'f' in +the regexp doesn't match 'e' in the string, so a dead end. Backtrack one +character and pick the second alternative in the second group 'd', 8 'd' +matches. The second grouping is satisfied, so set $2 to 'd', 9 We are at +the end of the regexp, so we are done! We have matched 'abcd' out of the +string "abcde" -=item SYNOPSIS +=item Extracting matches -=item DESCRIPTION +=item Matching repetitions -=over +C = match 'a' 1 or 0 times, C = match 'a' 0 or more times, i.e., +any number of times, C = match 'a' 1 or more times, i.e., at least +once, C = match at least C times, but not more than C times, +C = match at least C or more times, C = match exactly C +times, Principle 0: Taken as a whole, any regexp will be matched at the +earliest possible position in the string, Principle 1: In an alternation +C, the leftmost alternative that allows a match for the whole +regexp will be the one used, Principle 2: The maximal matching quantifiers +C, C<*>, C<+> and C<{n,m}> will in general match as much of the string +as possible while still allowing the whole regexp to match, Principle 3: If +there are two or more elements in a regexp, the leftmost greedy quantifier, +if any, will match as much of the string as possible while still allowing +the whole regexp to match. The next leftmost greedy quantifier, if any, +will try to match as much of the string remaining available to it as +possible, while still allowing the whole regexp to match. And so on, until +all the regexp elements are satisfied, C = match 'a' 0 or 1 times. Try +0 first, then 1, C = match 'a' 0 or more times, i.e., any number of +times, but as few times as possible, C = match 'a' 1 or more times, +i.e., at least once, but as few times as possible, C = match at +least C times, not more than C times, as few times as possible, +C = match at least C times, but as few times as possible, +C = match exactly C times. Because we match exactly C times, +C is equivalent to C and is just there for notational +consistency, Principle 3: If there are two or more elements in a regexp, +the leftmost greedy (non-greedy) quantifier, if any, will match as much +(little) of the string as possible while still allowing the whole regexp to +match. The next leftmost greedy (non-greedy) quantifier, if any, will try +to match as much (little) of the string remaining available to it as +possible, while still allowing the whole regexp to match. And so on, until +all the regexp elements are satisfied, 0 Start with the first letter in the +string 't', 1 The first quantifier '.*' starts out by matching the whole +string 'the cat in the hat', 2 'a' in the regexp element 'at' doesn't match +the end of the string. Backtrack one character, 3 'a' in the regexp +element 'at' still doesn't match the last letter of the string 't', so +backtrack one more character, 4 Now we can match the 'a' and the 't', 5 +Move on to the third element '.*'. Since we are at the end of the string +and '.*' can match 0 times, assign it the empty string, 6 We are done! -=item Private Variables via my() +=item Building a regexp -=item Persistent Private Variables +specifying the task in detail,, breaking down the problem into smaller +parts,, translating the small parts into regexps,, combining the regexps,, +and optimizing the final combined regexp -=item Temporary Values via local() +=item Using regular expressions in Perl -=item Lvalue subroutines +=back -=item Passing Symbol Table Entries (typeglobs) +=item Part 2: Power tools -=item When to Still Use local() +=over -1. You need to give a global variable a temporary value, especially $_, 2. -You need to create a local file or directory handle or a local function, 3. -You want to temporarily change just one element of an array or hash +=item More on characters, strings, and character classes -=item Pass by Reference +=item Compiling and saving regular expressions -=item Prototypes +=item Embedding comments and modifiers in a regular expression -=item Constant Functions +=item Non-capturing groupings -=item Overriding Built-in Functions +=item Looking ahead and looking behind -=item Autoloading +=item Using independent subexpressions to prevent backtracking -=item Subroutine Attributes +=item Conditional expressions -=back +=item A bit of magic: executing Perl code in a regular expression -=item SEE ALSO +=item Pragmas and debugging =back -=head2 perlmod - Perl modules (packages and symbol tables) +=item BUGS -=over +=item SEE ALSO -=item DESCRIPTION +=item AUTHOR AND COPYRIGHT =over -=item Packages - -=item Symbol Tables - -=item Package Constructors and Destructors - -=item Perl Classes - -=item Perl Modules +=item Acknowledgments =back -=item SEE ALSO - =back -=head2 perlpod - plain old documentation +=head2 perlref - Perl references and nested data structures =over +=item NOTE + =item DESCRIPTION =over -=item Verbatim Paragraph +=item Making References -=item Command Paragraph +=item Using References -=item Ordinary Block of Text +=item Symbolic references -=item The Intent +=item Not-so-symbolic references -=item Embedding Pods in Perl Modules +=item Pseudo-hashes: Using an array as a hash -=item Common Pod Pitfalls +=item Function Templates =back -=item SEE ALSO +=item WARNING -=item AUTHOR +=item SEE ALSO =back -=head2 perlstyle - Perl style guide +=head2 perlre - Perl regular expressions =over =item DESCRIPTION -=back - -=head2 perlmodlib - constructing new Perl modules and finding existing ones +i, m, s, x =over -=item DESCRIPTION +=item Regular Expressions -=item THE PERL MODULE LIBRARY +cntrl, graph, print, punct, xdigit -=over +=item Extended Patterns -=item Pragmatic Modules +C<(?#text)>, C<(?imsx-imsx)>, C<(?:pattern)>, C<(?imsx-imsx:pattern)>, +C<(?=pattern)>, C<(?!pattern)>, C<(?<=pattern)>, C<(?, C<(?{ +code })>, C<(??{ code })>, C<< (?>pattern) >>, +C<(?(condition)yes-pattern|no-pattern)>, C<(?(condition)yes-pattern)> -attributes, attrs, autouse, base, blib, bytes, charnames, constant, -diagnostics, fields, filetest, integer, less, locale, open, ops, overload, -re, sigtrap, strict, subs, utf8, vars, warnings +=item Backtracking -=item Standard Modules +=item Version 8 Regular Expressions -AnyDBM_File, AutoLoader, AutoSplit, B, B::Asmdata, B::Assembler, B::Bblock, -B::Bytecode, B::C, B::CC, B::Debug, B::Deparse, B::Disassembler, B::Lint, -B::Showlex, B::Stackobj, B::Terse, B::Xref, Benchmark, ByteLoader, CGI, -CGI::Apache, CGI::Carp, CGI::Cookie, CGI::Fast, CGI::Pretty, CGI::Push, -CGI::Switch, CPAN, CPAN::FirstTime, CPAN::Nox, Carp, Carp::Heavy, -Class::Struct, Cwd, DB, DB_File, Devel::SelfStubber, DirHandle, Dumpvalue, -English, Env, Exporter, Exporter::Heavy, ExtUtils::Command, -ExtUtils::Embed, ExtUtils::Install, ExtUtils::Installed, ExtUtils::Liblist, -ExtUtils::MM_Cygwin, ExtUtils::MM_OS2, ExtUtils::MM_Unix, ExtUtils::MM_VMS, -ExtUtils::MM_Win32, ExtUtils::MakeMaker, ExtUtils::Manifest, -ExtUtils::Mkbootstrap, ExtUtils::Mksymlists, ExtUtils::Packlist, -ExtUtils::testlib, Fatal, Fcntl, File::Basename, File::CheckTree, -File::Compare, File::Copy, File::DosGlob, File::Find, File::Path, -File::Spec, File::Spec::Functions, File::Spec::Mac, File::Spec::OS2, -File::Spec::Unix, File::Spec::VMS, File::Spec::Win32, File::Temp, -File::stat, FileCache, FileHandle, FindBin, Getopt::Long, Getopt::Std, -I18N::Collate, IO, IPC::Open2, IPC::Open3, Math::BigFloat, Math::BigInt, -Math::Complex, Math::Trig, NDBM_File, Net::Ping, Net::hostent, Net::netent, -Net::protoent, Net::servent, O, ODBM_File, Opcode, Pod::Checker, Pod::Find, -Pod::Html, Pod::InputObjects, Pod::LaTeX, Pod::Man, Pod::ParseUtils, -Pod::Parser, Pod::Plainer, Pod::Select, Pod::Text, Pod::Text::Color, -Pod::Text::Termcap, Pod::Usage, SDBM_File, Safe, Search::Dict, SelectSaver, -SelfLoader, Shell, Socket, Symbol, Term::ANSIColor, Term::Cap, -Term::Complete, Term::ReadLine, Test, Test::Harness, Text::Abbrev, -Text::ParseWords, Text::Soundex, Text::Wrap, Tie::Array, Tie::Handle, -Tie::Hash, Tie::RefHash, Tie::Scalar, Tie::SubstrHash, Time::Local, -Time::gmtime, Time::localtime, Time::tm, UNIVERSAL, User::grent, -User::pwent +=item Warning on \1 vs $1 -=item Extension Modules +=item Repeated patterns matching zero-length substring + +=item Combining pieces together + +C, C, C, C, C, C, +C, C, C, C, C, C<< (?>S) >>, C<(?=S)>, C<(?<=S)>, +C<(?!S)>, C<(?, C<(??{ EXPR })>, +C<(?(condition)yes-pattern|no-pattern)> + +=item Creating custom RE engines =back -=item CPAN +=item BUGS -Language Extensions and Documentation Tools, Development Support, Operating -System Interfaces, Networking, Device Control (modems) and InterProcess -Communication, Data Types and Data Type Utilities, Database Interfaces, -User Interfaces, Interfaces to / Emulations of Other Programming Languages, -File Names, File Systems and File Locking (see also File Handles), String -Processing, Language Text Processing, Parsing, and Searching, Option, -Argument, Parameter, and Configuration File Processing, -Internationalization and Locale, Authentication, Security, and Encryption, -World Wide Web, HTML, HTTP, CGI, MIME, Server and Daemon Utilities, -Archiving and Compression, Images, Pixmap and Bitmap Manipulation, Drawing, -and Graphing, Mail and Usenet News, Control Flow Utilities (callbacks and -exceptions etc), File Handle and Input/Output Stream Utilities, -Miscellaneous Modules, Africa, Asia, Australasia, Central America, Europe, -North America, South America +=item SEE ALSO -=item Modules: Creation, Use, and Abuse +=back + +=head2 perlform - Perl formats =over -=item Guidelines for Module Creation +=item DESCRIPTION -Do similar modules already exist in some form?, Try to design the new -module to be easy to extend and reuse, Some simple style guidelines, Select -what to export, Select a name for the module, Have you got it right?, -README and other Additional Files, A description of the -module/package/extension etc, A copyright notice - see below, Prerequisites -- what else you may need to have, How to build it - possible changes to -Makefile.PL etc, How to install it, Recent changes in this release, -especially incompatibilities, Changes / enhancements you plan to make in -the future, Adding a Copyright Notice, Give the module a -version/issue/release number, How to release and distribute a module, Take -care when changing a released module +=over -=item Guidelines for Converting Perl 4 Library Scripts into Modules +=item Format Variables -There is no requirement to convert anything, Consider the implications, -Make the most of the opportunity, The pl2pm utility will get you started, -Adds the standard Module prologue lines, Converts package specifiers from ' -to ::, Converts die(...) to croak(...), Several other minor changes +=back -=item Guidelines for Reusing Application Code +=item NOTES -Complete applications rarely belong in the Perl Module Library, Many -applications contain some Perl code that could be reused, Break-out the -reusable code into one or more separate module files, Take the opportunity -to reconsider and redesign the interfaces, In some cases the 'application' -can then be reduced to a small +=over + +=item Footers + +=item Accessing Formatting Internals =back -=item NOTE +=item WARNINGS =back -=head2 perlmodinstall - Installing CPAN Modules +=head2 perllocale - Perl locale handling (internationalization and +localization) =over =item DESCRIPTION +=item PREPARING TO USE LOCALES + +=item USING LOCALES + =over -=item PREAMBLE +=item The use locale pragma -B the file, B the file into a directory, B the -module (sometimes unnecessary), B the module +=item The setlocale function -=back +=item Finding locales -=item HEY +=item LOCALE PROBLEMS -=item AUTHOR +=item Temporarily fixing locale problems -=item COPYRIGHT +=item Permanently fixing locale problems + +=item Permanently fixing your system's locale configuration + +=item Fixing system locale configuration + +=item The localeconv function =back -=head2 perlnewmod - preparing a new module for distribution +=item LOCALE CATEGORIES =over -=item DESCRIPTION +=item Category LC_COLLATE: Collation -=over +=item Category LC_CTYPE: Character Types -=item Warning +=item Category LC_NUMERIC: Numeric Formatting -=item What should I make into a module? +=item Category LC_MONETARY: Formatting of monetary amounts -=item Step-by-step: Preparing the ground +=item LC_TIME -Look around, Check it's new, Discuss the need, Choose a name, Check again +=item Other categories -=item Step-by-step: Making the module +=back -Start with F, Use L and L, Use -L, Use L - wisely!, Use L, Write tests, Write the README +=item SECURITY -=item Step-by-step: Distributing your module +B (C, C, C, C and C):, +B (with C<\l>, C<\L>, C<\u> or C<\U>), +B (C):, B (C):, +B (printf() and write()):, B (lc(), lcfirst(), uc(), ucfirst()):, B (localeconv(), strcoll(), strftime(), strxfrm()):, B (isalnum(), isalpha(), isdigit(), isgraph(), +islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit()): -Get a CPAN user ID, C, Upload the -tarball, Announce to the modules list, Announce to clpa, Fix bugs! +=item ENVIRONMENT -=back +PERL_BADLANG, LC_ALL, LANGUAGE, LC_CTYPE, LC_COLLATE, LC_MONETARY, +LC_NUMERIC, LC_TIME, LANG -=item AUTHOR +=item NOTES -=item SEE ALSO +=over + +=item Backward compatibility + +=item I18N:Collate obsolete + +=item Sort speed and memory use impacts + +=item write() and LC_NUMERIC + +=item Freely available locale definitions + +=item I18n and l10n + +=item An imperfect standard =back -=head2 perltrap - Perl traps for the unwary +=item BUGS =over -=item DESCRIPTION +=item Broken systems -=over +=back -=item Awk Traps +=item SEE ALSO -=item C Traps +=item HISTORY -=item Sed Traps +=back -=item Shell Traps +=head2 perlunicode - Unicode support in Perl -=item Perl Traps +=over -=item Perl4 to Perl5 Traps +=item DESCRIPTION -Discontinuance, Deprecation, and BugFix traps, Parsing Traps, Numerical -Traps, General data type traps, Context Traps - scalar, list contexts, -Precedence Traps, General Regular Expression Traps using s///, etc, -Subroutine, Signal, Sorting Traps, OS Traps, DBM Traps, Unclassified Traps +=over -=item Discontinuance, Deprecation, and BugFix traps +=item Important Caveat -Discontinuance, Deprecation, BugFix, Discontinuance, Discontinuance, -Discontinuance, BugFix, Discontinuance, Discontinuance, BugFix, -Discontinuance, Deprecation, Discontinuance, Discontinuance +Input and Output Disciplines, Regular Expressions, C still needed +to enable a few features -=item Parsing Traps +=item Byte and Character semantics -Parsing, Parsing, Parsing, Parsing +=item Effects of character semantics -=item Numerical Traps +=item Character encodings for input and output -Numerical, Numerical, Numerical, Bitwise string ops +=back -=item General data type traps +=item CAVEATS -(Arrays), (Arrays), (Hashes), (Globs), (Globs), (Scalar String), -(Constants), (Scalars), (Variable Suicide) +=item SEE ALSO -=item Context Traps - scalar, list contexts +=back -(list context), (scalar context), (scalar context), (list, builtin) +=head2 perlipc - Perl interprocess communication (signals, fifos, pipes, +safe subprocesses, sockets, and semaphores) -=item Precedence Traps +=over -Precedence, Precedence, Precedence, Precedence, Precedence, Precedence, -Precedence +=item DESCRIPTION -=item General Regular Expression Traps using s///, etc. +=item Signals -Regular Expression, Regular Expression, Regular Expression, Regular -Expression, Regular Expression, Regular Expression, Regular Expression, -Regular Expression +=item Named Pipes -=item Subroutine, Signal, Sorting Traps +=over -(Signals), (Sort Subroutine), warn() won't let you specify a filehandle +=item WARNING -=item OS Traps +=back -(SysV), (SysV) +=item Using open() for IPC -=item Interpolation Traps +=over -Interpolation, Interpolation, Interpolation, Interpolation, Interpolation, -Interpolation, Interpolation, Interpolation, Interpolation +=item Filehandles -=item DBM Traps +=item Background Processes -DBM, DBM +=item Complete Dissociation of Child from Parent -=item Unclassified Traps +=item Safe Pipe Opens -C/C trap using returned value, C on empty string with -LIMIT specified +=item Bidirectional Communication with Another Process -=back +=item Bidirectional Communication with Yourself =back -=head2 perlport - Writing portable Perl +=item Sockets: Client/Server Communication =over -=item DESCRIPTION +=item Internet Line Terminators -Not all Perl programs have to be portable, Nearly all of Perl already I -portable +=item Internet TCP Clients and Servers -=item ISSUES +=item Unix-Domain TCP Clients and Servers + +=back + +=item TCP Clients with IO::Socket =over -=item Newlines +=item A Simple Client -=item Numbers endianness and Width +C, C, C -=item Files and Filesystems +=item A Webget Client -=item System Interaction +=item Interactive Client with IO::Socket -=item Interprocess Communication (IPC) +=back -=item External Subroutines (XS) +=item TCP Servers with IO::Socket -=item Standard Modules +Proto, LocalPort, Listen, Reuse -=item Time and Date +=item UDP: Message Passing -=item Character sets and character encoding +=item SysV IPC -=item Internationalisation +=item NOTES -=item System Resources +=item BUGS -=item Security +=item AUTHOR -=item Style +=item SEE ALSO =back -=item CPAN Testers +=head2 perlfork - Perl's fork() emulation -Mailing list: cpan-testers@perl.org, Testing results: -http://testers.cpan.org/ +=over -=item PLATFORMS +=item SYNOPSIS + +=item DESCRIPTION =over -=item Unix +=item Behavior of other Perl features in forked pseudo-processes -=item DOS and Derivatives +$$ or $PROCESS_ID, %ENV, chdir() and all other builtins that accept +filenames, wait() and waitpid(), kill(), exec(), exit(), Open handles to +files, directories and network sockets -Build instructions for OS/2, L +=item Resource limits -=item S +=item Killing the parent process -=item VMS +=item Lifetime of the parent process and pseudo-processes -=item VOS +=item CAVEATS AND LIMITATIONS -=item EBCDIC Platforms +BEGIN blocks, Open filehandles, Forking pipe open() not yet implemented, +Global state maintained by XSUBs, Interpreter embedded in larger +application, Thread-safety of extensions -=item Acorn RISC OS +=back -=item Other perls +=item BUGS + +=item AUTHOR + +=item SEE ALSO =back -=item FUNCTION IMPLEMENTATIONS +=head2 perlnumber - semantics of numbers and numeric operations in Perl =over -=item Alphabetical Listing of Perl Functions - --I FILEHANDLE, -I EXPR, -I, alarm SECONDS, alarm, binmode -FILEHANDLE, chmod LIST, chown LIST, chroot FILENAME, chroot, crypt -PLAINTEXT,SALT, dbmclose HASH, dbmopen HASH,DBNAME,MODE, dump LABEL, exec -LIST, fcntl FILEHANDLE,FUNCTION,SCALAR, flock FILEHANDLE,OPERATION, fork, -getlogin, getpgrp PID, getppid, getpriority WHICH,WHO, getpwnam NAME, -getgrnam NAME, getnetbyname NAME, getpwuid UID, getgrgid GID, getnetbyaddr -ADDR,ADDRTYPE, getprotobynumber NUMBER, getservbyport PORT,PROTO, getpwent, -getgrent, gethostent, getnetent, getprotoent, getservent, setpwent, -setgrent, sethostent STAYOPEN, setnetent STAYOPEN, setprotoent STAYOPEN, -setservent STAYOPEN, endpwent, endgrent, endhostent, endnetent, -endprotoent, endservent, getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR, glob, -ioctl FILEHANDLE,FUNCTION,SCALAR, kill SIGNAL, LIST, link OLDFILE,NEWFILE, -lstat FILEHANDLE, lstat EXPR, lstat, msgctl ID,CMD,ARG, msgget KEY,FLAGS, -msgsnd ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, open FILEHANDLE,EXPR, -open FILEHANDLE, pipe READHANDLE,WRITEHANDLE, readlink EXPR, readlink, -select RBITS,WBITS,EBITS,TIMEOUT, semctl ID,SEMNUM,CMD,ARG, semget -KEY,NSEMS,FLAGS, semop KEY,OPSTRING, setgrent, setpgrp PID,PGRP, -setpriority WHICH,WHO,PRIORITY, setpwent, setsockopt -SOCKET,LEVEL,OPTNAME,OPTVAL, shmctl ID,CMD,ARG, shmget KEY,SIZE,FLAGS, -shmread ID,VAR,POS,SIZE, shmwrite ID,STRING,POS,SIZE, socketpair -SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL, stat FILEHANDLE, stat EXPR, stat, -symlink OLDFILE,NEWFILE, syscall LIST, sysopen -FILEHANDLE,FILENAME,MODE,PERMS, system LIST, times, truncate -FILEHANDLE,LENGTH, truncate EXPR,LENGTH, umask EXPR, umask, utime LIST, -wait, waitpid PID,FLAGS +=item SYNOPSIS -=back +=item DESCRIPTION -=item CHANGES +=item Storing numbers -v1.47, 22 March 2000, v1.46, 12 February 2000, v1.45, 20 December 1999, -v1.44, 19 July 1999, v1.43, 24 May 1999, v1.42, 22 May 1999, v1.41, 19 May -1999, v1.40, 11 April 1999, v1.39, 11 February 1999, v1.38, 31 December -1998, v1.37, 19 December 1998, v1.36, 9 September 1998, v1.35, 13 August -1998, v1.33, 06 August 1998, v1.32, 05 August 1998, v1.30, 03 August 1998, -v1.23, 10 July 1998 +=item Numeric operators and numeric conversions -=item Supported Platforms +=item Flavors of Perl numeric operations -=item SEE ALSO +Arithmetic operators except, C, Arithmetic operators except, +C, Bitwise operators, C, Bitwise operators, C, Operators which expect an integer, Operators which expect a +string -=item AUTHORS / CONTRIBUTORS +=item AUTHOR -=item VERSION +=item SEE ALSO =back -=head2 perlsec - Perl security +=head2 perlthrtut - tutorial on threads in Perl =over =item DESCRIPTION -=over - -=item Laundering and Detecting Tainted Data - -=item Switches On the "#!" Line +=item What Is A Thread Anyway? -=item Cleaning Up Your Path +=item Threaded Program Models -=item Security Bugs +=over -=item Protecting Your Programs +=item Boss/Worker -=back +=item Work Crew -=item SEE ALSO +=item Pipeline =back -=head2 perlref - Perl references and nested data structures +=item Native threads -=over +=item What kind of threads are perl threads? -=item NOTE +=item Threadsafe Modules -=item DESCRIPTION +=item Thread Basics =over -=item Making References - -=item Using References - -=item Symbolic references - -=item Not-so-symbolic references +=item Basic Thread Support -=item Pseudo-hashes: Using an array as a hash +=item Creating Threads -=item Function Templates +=item Giving up control -=back +=item Waiting For A Thread To Exit -=item WARNING +=item Errors In Threads -=item SEE ALSO +=item Ignoring A Thread =back -=head2 perlre - Perl regular expressions +=item Threads And Data =over -=item DESCRIPTION +=item Shared And Unshared Data -i, m, s, x +=item Thread Pitfall: Races -=over +=item Controlling access: lock() -=item Regular Expressions +=item Thread Pitfall: Deadlocks -cntrl, graph, print, punct, xdigit +=item Queues: Passing Data Around -=item Extended Patterns +=back -C<(?#text)>, C<(?imsx-imsx)>, C<(?:pattern)>, C<(?imsx-imsx:pattern)>, -C<(?=pattern)>, C<(?!pattern)>, C<(?<=pattern)>, C<(?, C<(?{ -code })>, C<(??{ code })>, C<< (?>pattern) >>, -C<(?(condition)yes-pattern|no-pattern)>, C<(?(condition)yes-pattern)> +=item Threads And Code -=item Backtracking +=over -=item Version 8 Regular Expressions +=item Semaphores: Synchronizing Data Access -=item Warning on \1 vs $1 +Basic semaphores, Advanced Semaphores -=item Repeated patterns matching zero-length substring +=item Attributes: Restricting Access To Subroutines -=item Combining pieces together +=item Subroutine Locks -C, C, C, C, C, C, -C, C, C, C, C, C<< (?>S) >>, C<(?=S)>, C<(?<=S)>, -C<(?!S)>, C<(?, C<(??{ EXPR })>, -C<(?(condition)yes-pattern|no-pattern)> +=item Methods -=item Creating custom RE engines +=item Locking A Subroutine =back -=item BUGS +=item General Thread Utility Routines -=item SEE ALSO +=over -=back +=item What Thread Am I In? -=head2 perlform - Perl formats +=item Thread IDs -=over +=item Are These Threads The Same? -=item DESCRIPTION +=item What Threads Are Running? -=over +=back -=item Format Variables +=item A Complete Example -=back +=item Conclusion -=item NOTES +=item Bibliography =over -=item Footers - -=item Accessing Formatting Internals +=item Introductory Texts -=back +=item OS-Related References -=item WARNINGS +=item Other References =back -=head2 perllocale - Perl locale handling (internationalization and -localization) +=item Acknowledgements -=over +=item AUTHOR -=item DESCRIPTION +=item Copyrights -=item PREPARING TO USE LOCALES +=back -=item USING LOCALES +=head2 perlport - Writing portable Perl =over -=item The use locale pragma - -=item The setlocale function +=item DESCRIPTION -=item Finding locales +Not all Perl programs have to be portable, Nearly all of Perl already I +portable -=item LOCALE PROBLEMS +=item ISSUES -=item Temporarily fixing locale problems +=over -=item Permanently fixing locale problems +=item Newlines -=item Permanently fixing your system's locale configuration +=item Numbers endianness and Width -=item Fixing system locale configuration +=item Files and Filesystems -=item The localeconv function +=item System Interaction -=back +=item Interprocess Communication (IPC) -=item LOCALE CATEGORIES +=item External Subroutines (XS) -=over +=item Standard Modules -=item Category LC_COLLATE: Collation +=item Time and Date -=item Category LC_CTYPE: Character Types +=item Character sets and character encoding -=item Category LC_NUMERIC: Numeric Formatting +=item Internationalisation -=item Category LC_MONETARY: Formatting of monetary amounts +=item System Resources -=item LC_TIME +=item Security -=item Other categories +=item Style =back -=item SECURITY +=item CPAN Testers -B (C, C, C, C and C):, -B (with C<\l>, C<\L>, C<\u> or C<\U>), -B (C):, B (C):, -B (printf() and write()):, B (lc(), lcfirst(), uc(), ucfirst()):, B (localeconv(), strcoll(), strftime(), strxfrm()):, B (isalnum(), isalpha(), isdigit(), isgraph(), -islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit()): +Mailing list: cpan-testers@perl.org, Testing results: +http://testers.cpan.org/ -=item ENVIRONMENT +=item PLATFORMS -PERL_BADLANG, LC_ALL, LANGUAGE, LC_CTYPE, LC_COLLATE, LC_MONETARY, -LC_NUMERIC, LC_TIME, LANG +=over -=item NOTES +=item Unix -=over +=item DOS and Derivatives -=item Backward compatibility +Build instructions for OS/2, L -=item I18N:Collate obsolete +=item S -=item Sort speed and memory use impacts +=item VMS -=item write() and LC_NUMERIC +=item VOS -=item Freely available locale definitions +=item EBCDIC Platforms -=item I18n and l10n +=item Acorn RISC OS -=item An imperfect standard +=item Other perls =back -=item BUGS +=item FUNCTION IMPLEMENTATIONS =over -=item Broken systems +=item Alphabetical Listing of Perl Functions + +-I FILEHANDLE, -I EXPR, -I, alarm SECONDS, alarm, binmode +FILEHANDLE, chmod LIST, chown LIST, chroot FILENAME, chroot, crypt +PLAINTEXT,SALT, dbmclose HASH, dbmopen HASH,DBNAME,MODE, dump LABEL, exec +LIST, fcntl FILEHANDLE,FUNCTION,SCALAR, flock FILEHANDLE,OPERATION, fork, +getlogin, getpgrp PID, getppid, getpriority WHICH,WHO, getpwnam NAME, +getgrnam NAME, getnetbyname NAME, getpwuid UID, getgrgid GID, getnetbyaddr +ADDR,ADDRTYPE, getprotobynumber NUMBER, getservbyport PORT,PROTO, getpwent, +getgrent, gethostent, getnetent, getprotoent, getservent, setpwent, +setgrent, sethostent STAYOPEN, setnetent STAYOPEN, setprotoent STAYOPEN, +setservent STAYOPEN, endpwent, endgrent, endhostent, endnetent, +endprotoent, endservent, getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR, glob, +ioctl FILEHANDLE,FUNCTION,SCALAR, kill SIGNAL, LIST, link OLDFILE,NEWFILE, +lstat FILEHANDLE, lstat EXPR, lstat, msgctl ID,CMD,ARG, msgget KEY,FLAGS, +msgsnd ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, open FILEHANDLE,EXPR, +open FILEHANDLE, pipe READHANDLE,WRITEHANDLE, readlink EXPR, readlink, +select RBITS,WBITS,EBITS,TIMEOUT, semctl ID,SEMNUM,CMD,ARG, semget +KEY,NSEMS,FLAGS, semop KEY,OPSTRING, setgrent, setpgrp PID,PGRP, +setpriority WHICH,WHO,PRIORITY, setpwent, setsockopt +SOCKET,LEVEL,OPTNAME,OPTVAL, shmctl ID,CMD,ARG, shmget KEY,SIZE,FLAGS, +shmread ID,VAR,POS,SIZE, shmwrite ID,STRING,POS,SIZE, socketpair +SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL, stat FILEHANDLE, stat EXPR, stat, +symlink OLDFILE,NEWFILE, syscall LIST, sysopen +FILEHANDLE,FILENAME,MODE,PERMS, system LIST, times, truncate +FILEHANDLE,LENGTH, truncate EXPR,LENGTH, umask EXPR, umask, utime LIST, +wait, waitpid PID,FLAGS =back +=item CHANGES + +v1.47, 22 March 2000, v1.46, 12 February 2000, v1.45, 20 December 1999, +v1.44, 19 July 1999, v1.43, 24 May 1999, v1.42, 22 May 1999, v1.41, 19 May +1999, v1.40, 11 April 1999, v1.39, 11 February 1999, v1.38, 31 December +1998, v1.37, 19 December 1998, v1.36, 9 September 1998, v1.35, 13 August +1998, v1.33, 06 August 1998, v1.32, 05 August 1998, v1.30, 03 August 1998, +v1.23, 10 July 1998 + +=item Supported Platforms + =item SEE ALSO -=item HISTORY +=item AUTHORS / CONTRIBUTORS + +=item VERSION =back -=head2 perlunicode - Unicode support in Perl +=head2 perlsec - Perl security =over @@ -1893,21 +1973,18 @@ LC_NUMERIC, LC_TIME, LANG =over -=item Important Caveat +=item Laundering and Detecting Tainted Data -Input and Output Disciplines, Regular Expressions, C still needed -to enable a few features +=item Switches On the "#!" Line -=item Byte and Character semantics +=item Cleaning Up Your Path -=item Effects of character semantics +=item Security Bugs -=item Character encodings for input and output +=item Protecting Your Programs =back -=item CAVEATS - =item SEE ALSO =back @@ -2176,161 +2253,15 @@ isa(CLASS), can(METHOD), VERSION( [NEED] ) =item THINKING OF CODE REUSE -=item CLASS CONTEXT AND THE OBJECT - -=item INHERITING A CONSTRUCTOR - -=item DELEGATION - -=back - -=head2 perltie - how to hide an object class in a simple variable - -=over - -=item SYNOPSIS - -=item DESCRIPTION - -=over - -=item Tying Scalars - -TIESCALAR classname, LIST, FETCH this, STORE this, value, DESTROY this - -=item Tying Arrays - -TIEARRAY classname, LIST, FETCH this, index, STORE this, index, value, -DESTROY this - -=item Tying Hashes - -USER, HOME, CLOBBER, LIST, TIEHASH classname, LIST, FETCH this, key, STORE -this, key, value, DELETE this, key, CLEAR this, EXISTS this, key, FIRSTKEY -this, NEXTKEY this, lastkey, DESTROY this - -=item Tying FileHandles - -TIEHANDLE classname, LIST, WRITE this, LIST, PRINT this, LIST, PRINTF this, -LIST, READ this, LIST, READLINE this, GETC this, CLOSE this, DESTROY this - -=item The C Gotcha - -=back - -=item SEE ALSO - -=item BUGS - -=item AUTHOR - -=back - -=head2 perlipc - Perl interprocess communication (signals, fifos, pipes, -safe subprocesses, sockets, and semaphores) - -=over - -=item DESCRIPTION - -=item Signals - -=item Named Pipes - -=over - -=item WARNING - -=back - -=item Using open() for IPC - -=over - -=item Filehandles - -=item Background Processes - -=item Complete Dissociation of Child from Parent - -=item Safe Pipe Opens - -=item Bidirectional Communication with Another Process - -=item Bidirectional Communication with Yourself - -=back - -=item Sockets: Client/Server Communication - -=over - -=item Internet Line Terminators - -=item Internet TCP Clients and Servers - -=item Unix-Domain TCP Clients and Servers - -=back - -=item TCP Clients with IO::Socket - -=over - -=item A Simple Client - -C, C, C - -=item A Webget Client - -=item Interactive Client with IO::Socket - -=back - -=item TCP Servers with IO::Socket - -Proto, LocalPort, Listen, Reuse - -=item UDP: Message Passing - -=item SysV IPC - -=item NOTES - -=item BUGS - -=item AUTHOR - -=item SEE ALSO - -=back - -=head2 perlnumber - semantics of numbers and numeric operations in Perl - -=over - -=item SYNOPSIS - -=item DESCRIPTION - -=item Storing numbers - -=item Numeric operators and numeric conversions - -=item Flavors of Perl numeric operations - -Arithmetic operators except, C, Arithmetic operators except, -C, Bitwise operators, C, Bitwise operators, C, Operators which expect an integer, Operators which expect a -string - -=item AUTHOR +=item CLASS CONTEXT AND THE OBJECT -=item SEE ALSO +=item INHERITING A CONSTRUCTOR + +=item DELEGATION =back -=head2 perlfork - Perl's fork() emulation +=head2 perltie - how to hide an object class in a simple variable =over @@ -2340,155 +2271,224 @@ string =over -=item Behavior of other Perl features in forked pseudo-processes +=item Tying Scalars -$$ or $PROCESS_ID, %ENV, chdir() and all other builtins that accept -filenames, wait() and waitpid(), kill(), exec(), exit(), Open handles to -files, directories and network sockets +TIESCALAR classname, LIST, FETCH this, STORE this, value, DESTROY this -=item Resource limits +=item Tying Arrays -=item Killing the parent process +TIEARRAY classname, LIST, FETCH this, index, STORE this, index, value, +DESTROY this -=item Lifetime of the parent process and pseudo-processes +=item Tying Hashes -=item CAVEATS AND LIMITATIONS +USER, HOME, CLOBBER, LIST, TIEHASH classname, LIST, FETCH this, key, STORE +this, key, value, DELETE this, key, CLEAR this, EXISTS this, key, FIRSTKEY +this, NEXTKEY this, lastkey, DESTROY this -BEGIN blocks, Open filehandles, Forking pipe open() not yet implemented, -Global state maintained by XSUBs, Interpreter embedded in larger -application, Thread-safety of extensions +=item Tying FileHandles + +TIEHANDLE classname, LIST, WRITE this, LIST, PRINT this, LIST, PRINTF this, +LIST, READ this, LIST, READLINE this, GETC this, CLOSE this, DESTROY this + +=item The C Gotcha =back +=item SEE ALSO + =item BUGS =item AUTHOR -=item SEE ALSO - =back -=head2 perlthrtut - tutorial on threads in Perl +=head2 perlmod - Perl modules (packages and symbol tables) =over =item DESCRIPTION -=item What Is A Thread Anyway? +=over -=item Threaded Program Models +=item Packages -=over +=item Symbol Tables -=item Boss/Worker +=item Package Constructors and Destructors -=item Work Crew +=item Perl Classes -=item Pipeline +=item Perl Modules =back -=item Native threads - -=item What kind of threads are perl threads? +=item SEE ALSO -=item Threadsafe Modules +=back -=item Thread Basics +=head2 perlmodlib - constructing new Perl modules and finding existing ones =over -=item Basic Thread Support +=item DESCRIPTION -=item Creating Threads +=item THE PERL MODULE LIBRARY -=item Giving up control +=over -=item Waiting For A Thread To Exit +=item Pragmatic Modules -=item Errors In Threads +attributes, attrs, autouse, base, blib, bytes, charnames, constant, +diagnostics, fields, filetest, integer, less, locale, open, ops, overload, +re, sigtrap, strict, subs, utf8, vars, warnings -=item Ignoring A Thread +=item Standard Modules -=back +AnyDBM_File, AutoLoader, AutoSplit, B, B::Asmdata, B::Assembler, B::Bblock, +B::Bytecode, B::C, B::CC, B::Debug, B::Deparse, B::Disassembler, B::Lint, +B::Showlex, B::Stackobj, B::Terse, B::Xref, Benchmark, ByteLoader, CGI, +CGI::Apache, CGI::Carp, CGI::Cookie, CGI::Fast, CGI::Pretty, CGI::Push, +CGI::Switch, CPAN, CPAN::FirstTime, CPAN::Nox, Carp, Carp::Heavy, +Class::Struct, Cwd, DB, DB_File, Devel::SelfStubber, DirHandle, Dumpvalue, +English, Env, Exporter, Exporter::Heavy, ExtUtils::Command, +ExtUtils::Embed, ExtUtils::Install, ExtUtils::Installed, ExtUtils::Liblist, +ExtUtils::MM_Cygwin, ExtUtils::MM_OS2, ExtUtils::MM_Unix, ExtUtils::MM_VMS, +ExtUtils::MM_Win32, ExtUtils::MakeMaker, ExtUtils::Manifest, +ExtUtils::Mkbootstrap, ExtUtils::Mksymlists, ExtUtils::Packlist, +ExtUtils::testlib, Fatal, Fcntl, File::Basename, File::CheckTree, +File::Compare, File::Copy, File::DosGlob, File::Find, File::Path, +File::Spec, File::Spec::Functions, File::Spec::Mac, File::Spec::OS2, +File::Spec::Unix, File::Spec::VMS, File::Spec::Win32, File::Temp, +File::stat, FileCache, FileHandle, FindBin, Getopt::Long, Getopt::Std, +I18N::Collate, IO, IPC::Open2, IPC::Open3, Math::BigFloat, Math::BigInt, +Math::Complex, Math::Trig, NDBM_File, Net::Ping, Net::hostent, Net::netent, +Net::protoent, Net::servent, O, ODBM_File, Opcode, Pod::Checker, Pod::Find, +Pod::Html, Pod::InputObjects, Pod::LaTeX, Pod::Man, Pod::ParseUtils, +Pod::Parser, Pod::Plainer, Pod::Select, Pod::Text, Pod::Text::Color, +Pod::Text::Termcap, Pod::Usage, SDBM_File, Safe, Search::Dict, SelectSaver, +SelfLoader, Shell, Socket, Symbol, Term::ANSIColor, Term::Cap, +Term::Complete, Term::ReadLine, Test, Test::Harness, Text::Abbrev, +Text::ParseWords, Text::Soundex, Text::Wrap, Tie::Array, Tie::Handle, +Tie::Hash, Tie::RefHash, Tie::Scalar, Tie::SubstrHash, Time::Local, +Time::gmtime, Time::localtime, Time::tm, UNIVERSAL, User::grent, +User::pwent -=item Threads And Data +=item Extension Modules -=over +=back -=item Shared And Unshared Data +=item CPAN -=item Thread Pitfall: Races +Language Extensions and Documentation Tools, Development Support, Operating +System Interfaces, Networking, Device Control (modems) and InterProcess +Communication, Data Types and Data Type Utilities, Database Interfaces, +User Interfaces, Interfaces to / Emulations of Other Programming Languages, +File Names, File Systems and File Locking (see also File Handles), String +Processing, Language Text Processing, Parsing, and Searching, Option, +Argument, Parameter, and Configuration File Processing, +Internationalization and Locale, Authentication, Security, and Encryption, +World Wide Web, HTML, HTTP, CGI, MIME, Server and Daemon Utilities, +Archiving and Compression, Images, Pixmap and Bitmap Manipulation, Drawing, +and Graphing, Mail and Usenet News, Control Flow Utilities (callbacks and +exceptions etc), File Handle and Input/Output Stream Utilities, +Miscellaneous Modules, Africa, Asia, Australasia, Central America, Europe, +North America, South America -=item Controlling access: lock() +=item Modules: Creation, Use, and Abuse -=item Thread Pitfall: Deadlocks +=over -=item Queues: Passing Data Around +=item Guidelines for Module Creation -=back +Do similar modules already exist in some form?, Try to design the new +module to be easy to extend and reuse, Some simple style guidelines, Select +what to export, Select a name for the module, Have you got it right?, +README and other Additional Files, A description of the +module/package/extension etc, A copyright notice - see below, Prerequisites +- what else you may need to have, How to build it - possible changes to +Makefile.PL etc, How to install it, Recent changes in this release, +especially incompatibilities, Changes / enhancements you plan to make in +the future, Adding a Copyright Notice, Give the module a +version/issue/release number, How to release and distribute a module, Take +care when changing a released module -=item Threads And Code +=item Guidelines for Converting Perl 4 Library Scripts into Modules -=over +There is no requirement to convert anything, Consider the implications, +Make the most of the opportunity, The pl2pm utility will get you started, +Adds the standard Module prologue lines, Converts package specifiers from ' +to ::, Converts die(...) to croak(...), Several other minor changes -=item Semaphores: Synchronizing Data Access +=item Guidelines for Reusing Application Code -Basic semaphores, Advanced Semaphores +Complete applications rarely belong in the Perl Module Library, Many +applications contain some Perl code that could be reused, Break-out the +reusable code into one or more separate module files, Take the opportunity +to reconsider and redesign the interfaces, In some cases the 'application' +can then be reduced to a small -=item Attributes: Restricting Access To Subroutines +=back -=item Subroutine Locks +=item NOTE -=item Methods +=back -=item Locking A Subroutine +=head2 perlmodinstall - Installing CPAN Modules -=back +=over -=item General Thread Utility Routines +=item DESCRIPTION =over -=item What Thread Am I In? +=item PREAMBLE -=item Thread IDs +B the file, B the file into a directory, B the +module (sometimes unnecessary), B the module -=item Are These Threads The Same? +=back -=item What Threads Are Running? +=item HEY + +=item AUTHOR + +=item COPYRIGHT =back -=item A Complete Example +=head2 perlnewmod - preparing a new module for distribution -=item Conclusion +=over -=item Bibliography +=item DESCRIPTION =over -=item Introductory Texts +=item Warning -=item OS-Related References +=item What should I make into a module? -=item Other References +=item Step-by-step: Preparing the ground -=back +Look around, Check it's new, Discuss the need, Choose a name, Check again -=item Acknowledgements +=item Step-by-step: Making the module -=item AUTHOR +Start with F, Use L and L, Use +L, Use L - wisely!, Use L, Write tests, Write the README -=item Copyrights +=item Step-by-step: Distributing your module -=back +Get a CPAN user ID, C, Upload the +tarball, Announce to the modules list, Announce to clpa, Fix bugs! -=head2 perldiag - various Perl diagnostics +=back -=over +=item AUTHOR -=item DESCRIPTION +=item SEE ALSO =back @@ -4676,8 +4676,9 @@ probably be written as "%s", %s() called too early to check prototype, %s argument is not a HASH or ARRAY element, %s argument is not a HASH or ARRAY element or slice, %s argument is not a subroutine name, %s package attribute may clash with future reserved word: %s, (in cleanup) %s, <> -should be quotes, Attempt to join self, Bad evalled substitution pattern, -Bad realloc() ignored, Bareword found in conditional, Binary number > +should be quotes, Ambiguous range in transliteration operator, Attempt to +join self, Bad evalled substitution pattern, Bad realloc() ignored, +Bareword found in conditional, Binary number > 0b11111111111111111111111111111111 non-portable, Bit vector size > 32 non-portable, Buffer overflow in prime_env_iter: %s, Can't check filesystem of script "%s", Can't declare class for non-scalar %s in "%s", Can't @@ -4695,28 +4696,28 @@ explicit package name, Hexadecimal number > 0xffffffff non-portable, Ill-formed CRTL environ value "%s", Ill-formed message in prime_env_iter: |%s|, Illegal binary digit %s, Illegal binary digit %s ignored, Illegal number of bits in vec, Integer overflow in %s number, Invalid %s attribute: -%s, Invalid %s attributes: %s, invalid [] range "%s" in regexp, Invalid -separator character %s in attribute list, Invalid separator character %s in -subroutine attribute list, leaving effective %s failed, Lvalue subs -returning %s not implemented yet, Method %s not permitted, Missing -%sbrace%s on \N{}, Missing command in piped open, Missing name in "my sub", -No %s specified for -%c, No package name allowed for variable %s in "our", -No space allowed after -%c, no UTC offset information; assuming local time -is UTC, Octal number > 037777777777 non-portable, panic: del_backref, -panic: kid popen errno read, panic: magic_killbackrefs, Parentheses missing -around "%s" list, Possible Y2K bug: %s, pragma "attrs" is deprecated, use -"sub NAME : ATTRS" instead, Premature end of script headers, Repeat count -in pack overflows, Repeat count in unpack overflows, realloc() of freed -memory ignored, Reference is already weak, setpgrp can't take arguments, -Strange *+?{} on zero-length expression, switching effective %s is not -implemented, This Perl can't reset CRTL environ elements (%s), This Perl -can't set CRTL environ elements (%s=%s), Too late to run %s block, Unknown -open() mode '%s', Unknown process %x sent message to prime_env_iter: %s, -Unrecognized escape \\%c passed through, Unterminated attribute parameter -in attribute list, Unterminated attribute list, Unterminated attribute -parameter in subroutine attribute list, Unterminated subroutine attribute -list, Value of CLI symbol "%s" too long, Version number must be a constant -number +%s, Invalid %s attributes: %s, invalid [] range "%s" in regexp, invalid [] +range "%s" in transliteration operator, Invalid separator character %s in +attribute list, Invalid separator character %s in subroutine attribute +list, leaving effective %s failed, Lvalue subs returning %s not implemented +yet, Method %s not permitted, Missing %sbrace%s on \N{}, Missing command in +piped open, Missing name in "my sub", No %s specified for -%c, No package +name allowed for variable %s in "our", No space allowed after -%c, no UTC +offset information; assuming local time is UTC, Octal number > 037777777777 +non-portable, panic: del_backref, panic: kid popen errno read, panic: +magic_killbackrefs, Parentheses missing around "%s" list, Possible Y2K bug: +%s, pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead, Premature +end of script headers, Repeat count in pack overflows, Repeat count in +unpack overflows, realloc() of freed memory ignored, Reference is already +weak, setpgrp can't take arguments, Strange *+?{} on zero-length +expression, switching effective %s is not implemented, This Perl can't +reset CRTL environ elements (%s), This Perl can't set CRTL environ elements +(%s=%s), Too late to run %s block, Unknown open() mode '%s', Unknown +process %x sent message to prime_env_iter: %s, Unrecognized escape \\%c +passed through, Unterminated attribute parameter in attribute list, +Unterminated attribute list, Unterminated attribute parameter in subroutine +attribute list, Unterminated subroutine attribute list, Value of CLI symbol +"%s" too long, Version number must be a constant number =item New tests @@ -6078,6 +6079,47 @@ C, F =back +=head2 perlposix-bc, README.posix-bc - building and installing Perl for +BS2000 POSIX. + +=over + +=item SYNOPSIS + +=item DESCRIPTION + +=over + +=item gzip + +=item bison + +=item Unpacking + +=item Compiling + +=item Testing + +=item Install + +=item Using Perl + +=back + +=item AUTHORS + +=item SEE ALSO + +=over + +=item Mailing list + +=back + +=item HISTORY + +=back + =head2 perlvms - VMS-specific documentation for Perl =over diff --git a/pp_hot.c b/pp_hot.c index 1a9416e..66d22bc 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -2236,7 +2236,9 @@ S_get_db_sub(pTHX_ SV **svp, CV *cv) && (gv = (GV*)*svp) ))) { /* Use GV from the stack as a fallback. */ /* GV is potentially non-unique, or contain different CV. */ - sv_setsv(dbsv, newRV((SV*)cv)); + SV *tmp = newRV((SV*)cv); + sv_setsv(dbsv, tmp); + SvREFCNT_dec(tmp); } else { gv_efullname3(dbsv, gv, Nullch); diff --git a/regexec.c b/regexec.c index 49a081f..6bddf2d 100644 --- a/regexec.c +++ b/regexec.c @@ -3001,6 +3001,8 @@ S_regmatch(pTHX_ regnode *prog) else c1 = c2 = -1000; PL_reginput = locinput; + if (paren) + PL_regendp[paren] = -1; if (minmod) { CHECKPOINT lastcp; minmod = 0; diff --git a/sv.c b/sv.c index 1b39437..6ee91be 100644 --- a/sv.c +++ b/sv.c @@ -6133,6 +6133,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV /* INTEGERS */ case 'p': + if (alt) + goto unknown; if (args) uv = PTR2UV(va_arg(*args, void*)); else @@ -6429,7 +6431,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV } } else if (svix < svmax) - sv_setuv(svargs[svix++], (UV)i); + sv_setuv_mg(svargs[svix++], (UV)i); continue; /* not "break" */ /* UNKNOWN */ diff --git a/t/op/re_tests b/t/op/re_tests index 37e8ee3..263bded 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -750,5 +750,6 @@ tt+$ xxxtt y - - ^([a-z]:) C:/ n - - '^\S\s+aa$'m \nx aa y - - (^|a)b ab y - - +^([ab]*?)(b)?(c)$ abac y -$2- -- (?i) y - - '(?!\A)x'm a\nxb\n y - - diff --git a/t/op/sprintf.t b/t/op/sprintf.t index d731ac4..50b4c77 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -34,9 +34,14 @@ for ($i = 1; @tests; $i++) { $x = sprintf(">$template<", defined @$evalData ? @$evalData : $evalData); substr($x, -1, 0) = $w if $w; + ($y = $x) =~ s/([Ee][-+])0(\d)/$1$2/g; # $y has 3 exponent digits, not 2 if ($x eq ">$result<") { print "ok $i\n"; } + elsif ($y eq ">$result<") # Some C libraries always give + { # three-digit exponent + print("ok $i >$result< $x # three-digit exponent accepted\n"); + } else { print("not ok $i >$template< >$data< >$result< $x", $comment ? " # $comment\n" : "\n"); @@ -56,30 +61,18 @@ for ($i = 1; @tests; $i++) { # # template data result __END__ ->%6 .6s< >''< >%6 .6s INVALID< >First test from old sprintf.t< >%6. 6s< >''< >%6. 6s INVALID< >(See use of $w in code above)< +>%6 .6s< >''< >%6 .6s INVALID< >%6.6 s< >''< >%6.6 s INVALID< ->%3s< >'hi'< > hi< ->%-4s< >123< >123 < ->%%foo< >'bar'< >%foo< ->%.0d< >0< >< ->%5d< >456< > 456< ->%#x< >0< >0< ->%c< >ord('A')< >A< ->%3.1f< >3.0999< >3.1< ->%b< >11< >1011< ->%x< >171< >ab< ->%X< >171< >AB< ->%#b< >11< >0b1011< ->%#x< >171< >0xab< ->%#X< >171< >0XAB< >Last test from old sprintf.t< ->%A< >''< >%A INVALID< >First new test< +>%A< >''< >%A INVALID< >%B< >''< >%B INVALID< >%C< >''< >%C INVALID< >%D< >0x7fffffff< >2147483647< >Synonym for %ld< >%E< >123456.789< >1.234568E+05< >Like %e, but using upper-case "E"< >%F< >123456.789< >123456.789000< >Synonym for %f< >%G< >1234567.89< >1.23457E+06< >Like %g, but using upper-case "E"< +>%G< >1234567e96< >1.23457E+102< +>%G< >.1234567e-101< >1.23457E-102< >%G< >12345.6789< >12345.7< >%H< >''< >%H INVALID< >%I< >''< >%I INVALID< @@ -88,13 +81,13 @@ __END__ >%L< >''< >%L INVALID< >%M< >''< >%M INVALID< >%N< >''< >%N INVALID< ->%O< >2**32-1< >37777777777< >Synonym for %lo< +>%O< >2**32-1< >37777777777< >Synonum for %lo< >%P< >''< >%P INVALID< >%Q< >''< >%Q INVALID< >%R< >''< >%R INVALID< >%S< >''< >%S INVALID< >%T< >''< >%T INVALID< ->%U< >2**32-1< >4294967295< >Synonym for %lu< +>%U< >2**32-1< >4294967295< >Synonum for %lu< >%V< >''< >%V INVALID< >%W< >''< >%W INVALID< >%X< >2**32-1< >FFFFFFFF< >Like %x, but with u/c letters< @@ -147,8 +140,12 @@ __END__ >%v+-3d< >"\01\02\03"< >+1 .2 .3 < >%v4.3d< >"\01\02\03"< > 001. 002. 003< >%v04.3d< >"\01\02\03"< >0001.0002.0003< ->%*v02d< >['-', "\0\6\35"]< >00-06-29< +>%*v02d< >['-', "\0\7\13"]< >00-07-11< >%e< >1234.875< >1.234875e+03< +>%e< >0.000012345< >1.234500e-05< +>%e< >1234567E96< >1.234567e+102< +>%e< >0< >0.000000e+00< +>%e< >.1234567E-101< >1.234567e-102< >%+e< >1234.875< >+1.234875e+03< >%#e< >1234.875< >1.234875e+03< >%e< >-1234.875< >-1.234875e+03< @@ -180,6 +177,11 @@ __END__ >%+-8.1f< >-1234.875< >-1234.9 < >%+8.1f< >-1234.875< > -1234.9< >%*.*f< >[5, 2, 12.3456]< >12.35< +>%f< >0< >0.000000< +>%.0f< >0< >0< +>%.0f< >2**38< >274877906944< >Should have exact int'l rep'n< +>%.0f< >0.5< >0< +>%.0f< >-0.5< >-0< >%g< >12345.6789< >12345.7< >%+g< >12345.6789< >+12345.7< >%#g< >12345.6789< >12345.7< @@ -200,6 +202,11 @@ __END__ >%g< >-1234567.89< >-1.23457e+06< >%+g< >-1234567.89< >-1.23457e+06< >%#g< >-1234567.89< >-1.23457e+06< +>%g< >0.00012345< >0.00012345< +>%g< >0.000012345< >1.2345e-05< +>%g< >1234567E96< >1.23457e+102< +>%g< >.1234567E-101< >1.23457e-102< +>%g< >0< >0< >%13g< >1234567.89< > 1.23457e+06< >%+13g< >1234567.89< > +1.23457e+06< >%013g< >1234567.89< >001.23457e+06< diff --git a/t/op/taint.t b/t/op/taint.t index af57834..44f50ae 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -618,8 +618,8 @@ else { my $sent = "foobar"; my $rcvd; my $size = 2000; - my $id = shmget(IPC_PRIVATE, $size, S_IRWXU) || - warn "# shmget failed: $!\n"; + my $id = shmget(IPC_PRIVATE, $size, S_IRWXU); + if (defined $id) { if (shmwrite($id, $sent, 0, 60)) { if (shmread($id, $rcvd, 0, 60)) { @@ -630,7 +630,7 @@ else { } else { warn "# shmwrite failed: $!\n"; } - shmctl($id, IPC_RMID, 0) || warn "# shmctl failed: $!\n"; + shmctl($id, IPC_RMID, 0) or warn "# shmctl failed: $!\n"; } else { warn "# shmget failed: $!\n"; } @@ -666,7 +666,7 @@ else { } else { warn "# msgsnd failed\n"; } - msgctl($id, IPC_RMID, 0) || warn "# msgctl failed: $!\n"; + msgctl($id, IPC_RMID, 0) or warn "# msgctl failed: $!\n"; } else { warn "# msgget failed\n"; } diff --git a/t/op/tr.t b/t/op/tr.t index 100dcfe..2c1c4fd 100755 --- a/t/op/tr.t +++ b/t/op/tr.t @@ -5,7 +5,7 @@ BEGIN { unshift @INC, "../lib"; } -print "1..15\n"; +print "1..23\n"; $_ = "abcdefghijklmnopqrstuvwxyz"; @@ -108,3 +108,41 @@ $y = $x =~ tr/\x{190}/\x{190}/; print "not " if $y != 0; print "ok 15\n"; } + +# 16: test brokenness with tr/a-z-9//; +$_ = "abcdefghijklmnopqrstuvwxyz"; +eval "tr/a-z-9/ /"; +print (($@ =~ /^Ambiguous range in transliteration operator/) + ? '' : 'not ', "ok 16\n"); + +# 17-19: Make sure leading and trailing hyphens still work +$_ = "car-rot9"; +tr/-a-m/./; +print (($_ eq '..r.rot9') ? '' : 'not ', "ok 17\n"); + +$_ = "car-rot9"; +tr/a-m-/./; +print (($_ eq '..r.rot9') ? '' : 'not ', "ok 18\n"); + +$_ = "car-rot9"; +tr/-a-m-/./; +print (($_ eq '..r.rot9') ? '' : 'not ', "ok 19\n"); + +$_ = "abcdefghijklmnop"; +tr/ae-hn/./; +print (($_ eq '.bcd....ijklm.op') ? '' : 'not ', "ok 20\n"); + +$_ = "abcdefghijklmnop"; +tr/a-cf-kn-p/./; +print (($_ eq '...de......lm...') ? '' : 'not ', "ok 21\n"); + +$_ = "abcdefghijklmnop"; +tr/a-ceg-ikm-o/./; +print (($_ eq '...d.f...j.l...p') ? '' : 'not ', "ok 22\n"); + +# 23: Test reversed range check +# 20000705 MJD +eval "tr/m-d/ /"; +print (($@ =~ /^Invalid \[\] range "m-d" in transliteration operator/) + ? '' : 'not ', "ok 23\n"); + diff --git a/t/op/write.t b/t/op/write.t index 87d5042..593c69a 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -1,6 +1,6 @@ #!./perl -print "1..8\n"; +print "1..9\n"; my $CAT = ($^O eq 'MSWin32') ? 'type' : 'cat'; @@ -201,3 +201,19 @@ $this,$that $that = 8; write LEX; } +# LEX_INTERPNORMAL test +my %e = ( a => 1 ); +format OUT4 = +@<<<<<< +"$e{a}" +. +open OUT4, ">Op_write.tmp" or die "Can't create Op_write.tmp"; +write (OUT4); +close OUT4; +if (`$CAT Op_write.tmp` eq "1\n") { + print "ok 9\n"; + unlink "Op_write.tmp"; + } +else { + print "not ok 9\n"; + } diff --git a/t/pragma/overload.t b/t/pragma/overload.t index f9a9c59..78ca147 100755 --- a/t/pragma/overload.t +++ b/t/pragma/overload.t @@ -417,7 +417,7 @@ EOF m'try it'; s'first part'second part'; s/yet another/tail here/; - tr/z-Z/z-Z/; + tr/A-Z/a-z/; } test($out, '__'); # 117 @@ -425,7 +425,7 @@ test($out1, '__'); # 128 test($out2, "__foo_<,\,>_"); # 129 test("@q1", "foo q f'o\\\\o q a\\a qq ,\\, qq oups qq oups1 - q second part q tail here s z-Z tr z-Z tr"); # 130 + q second part q tail here s A-Z tr a-z tr"); # 130 test("@qr1", "b\\b qq .\\. qq try it q first part q yet another qq"); # 131 test($res, 1); # 132 test($a, "_ max) { + Perl_croak(aTHX_ + "Invalid [] range \"%c-%c\" in transliteration operator", + min, max); + } + #ifndef ASCIIish if ((isLOWER(min) && isLOWER(max)) || (isUPPER(min) && isUPPER(max))) { @@ -1261,11 +1269,15 @@ S_scan_const(pTHX_ char *start) /* mark the range as done, and continue */ dorange = FALSE; + didrange = TRUE; continue; - } + } /* range begins (ignore - as first or last char) */ else if (*s == '-' && s+1 < send && s != start) { + if (didrange) { + croak("Ambiguous range in transliteration operator"); + } if (utf) { *d++ = (char)0xff; /* use illegal utf8 byte--see pmtrans */ s++; @@ -1273,7 +1285,9 @@ S_scan_const(pTHX_ char *start) } dorange = TRUE; s++; - } + } else { + didrange = FALSE; + } } /* if we get here, we're not doing a transliteration */ @@ -3158,7 +3172,7 @@ Perl_yylex(pTHX) yyerror("Unmatched right curly bracket"); else PL_expect = (expectation)PL_lex_brackstack[--PL_lex_brackets]; - if (PL_lex_brackets < PL_lex_formbrack) + if (PL_lex_brackets < PL_lex_formbrack && PL_lex_state != LEX_INTERPNORMAL) PL_lex_formbrack = 0; if (PL_lex_state == LEX_INTERPNORMAL) { if (PL_lex_brackets == 0) { @@ -7162,7 +7176,7 @@ S_scan_formline(pTHX_ register char *s) bool needargs = FALSE; while (!needargs) { - if (*s == '.' || *s == '}') { + if (*s == '.' || *s == /*{*/'}') { /*SUPPRESS 530*/ #ifdef PERL_STRICT_CR for (t = s+1;SPACE_OR_TAB(*t); t++) ;