summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
Commit message (Collapse)AuthorAgeFilesLines
* Still cleaning up Y2K residue積丹尼 Dan Jacobson2023-05-011-1/+1
| | | | | Else... you'll get something recognizable back last century (e.g., 99 for 1999) , but what currently (123) looks more like https://en.wikipedia.org/wiki/Republic_of_China_calendar (112) than anything anyone else on the planet would understand! Also, my correction ensures the man page will still be correct after the year 9999!
* Fix some wording per @demerphqScott Baker2023-03-301-10/+9
|
* Add docs for BEGIN, INIT, CHECK for pop()Scott Baker2023-03-301-0/+3
|
* Add a section about additional blocksScott Baker2023-03-301-0/+3
|
* Update shift() docs with examplesScott Baker2023-03-301-8/+17
| | | | | | Make wording consistent Foobar
* Update pop() docs with examplesScott Baker2023-03-301-6/+15
|
* pp_ctl.c - add support for hooking require.Yves Orton2023-03-181-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This defines a new magic hash C<%{^HOOK}> which is intended to be used for hooking keywords. It is similar to %SIG in that the values it contains are validated on set, and it is not allowed to store something in C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be coderefs (people can use currying if they really want to put an object in there, the API is deliberately simple.) The C<%{^HOOK}> hash is documented to have keys of the form "${keyword}__${phase}" where $phase is either "before" or "after" and in this initial release two hooks are supported, "require__before" and "require__after": The C<require__before> hook is called before require is executed, including any @INC hooks that might be fired. It is called with the path of the file being required, just as would be stored in %INC. The hook may alter the filename by writing to $_[0] and it may return a coderef to be executed *after* the require has completed, otherwise the return is ignored. This coderef is also called with the path of the file which was required, and it will be called regardless as to whether the require (or its dependencies) die during execution. This mechanism makes it trivial and safe to share state between the initial hook and the coderef it returns. The C<require__after> hook is similar to the C<require__before> hook however except that it is called after the require completes (successfully or not), and its return is ignored always.
* Re-work wordingScott Baker2023-02-101-1/+1
|
* Move talk of `$_` above example to be consistent with other funcsScott Baker2023-02-101-3/+1
|
* Add examples and clarify wordingScott Baker2023-02-101-5/+11
|
* Initial attack at pod/perlclass.podPaul "LeoNerd" Evans2023-02-101-7/+64
|
* [doc] perlfunc: remove extra "the"Elvin Aslanov2023-02-081-1/+1
| | | Remove the duplicate "the" introduced in 0de69e372d3baf843522c30d8711b6513c2a472b
* perlfunc/require: Note that AUTOLOAD cannot resolve INCDIRTony Cook2023-02-081-0/+3
|
* Clarify perldoc bless per #18713Joe McMahon2023-02-081-18/+57
| | | | | | | - Specifically calls out the possible invocations - Breaks out the specific use cases and why to use them - Notes the things to avoid and why in clearer language - Update .mailmap so that tests all pass
* Add missing closing parens to the examplesScott Baker2023-02-071-3/+2
| | | | Also removes a comment which is duplicated.
* Remove the "technical" explanationScott Baker2023-02-071-12/+0
|
* Move return example after explanationScott Baker2023-02-071-3/+4
|
* Add some examples for push()Scott Baker2023-02-071-2/+18
|
* Add some closing parens I missed in the first passScott Baker2023-01-251-2/+2
|
* Put the example after the explanationScott Baker2023-01-241-2/+4
|
* Add some examples to `unshift()` docsScott Baker2023-01-241-5/+12
|
* Correct sort docs about value of the sort func.Andy Lester2023-01-141-1/+1
|
* <> to readline documentation updatesScott Baker2022-12-171-1/+1
|
* pod/ - document $INC and INCDIRYves Orton2022-12-091-26/+105
|
* Upper-case term for consistency with other 'substr' argumentsJames E Keenan2022-12-051-1/+1
| | | | As noted by Eugen Konkov in https://github.com/Perl/perl5/issues/20560.
* perlfunc.pod - document module_true in the require entryYves Orton2022-11-011-2/+8
| | | | A brief note pointing people at the feature manpage.
* Clarify perlfunc sleep entryKarl Williamson2022-10-251-1/+4
| | | | Note what happens if a fraction, and add markup.
* Document that "select" affects "say"'s default filehandle, tooE. Choroba2022-09-031-4/+4
|
* op.c - Restrict nested eval/BEGIN blocks to a user controllable maximumYves Orton2022-09-021-0/+10
| | | | | | | | | | | | | | | Nested BEGIN blocks can cause us to segfault by exhausting the C stack. Eg: perl -le'sub f { eval "BEGIN { f() }" } f()' will segfault. This adds a new interpreter var PL_eval_begin_nest_depth to keep track of how many layer of eval/BEGIN we have seen, and a new reserved variable called ${^MAX_NESTED_EVAL_BEGIN_BLOCKS} which can be used to raise or lower the limit. When set to 0 it blocks BEGIN entirely, which might be useful from time to time. This fixes https://github.com/Perl/perl5/issues/20176
* Add a new env var PERL_RAND_SEEDYves Orton2022-08-121-1/+15
| | | | | | | | | | | | | | | | | | | | | This env var can be used to trigger a repeatable run of a script which calls C<srand()> with no arguments, either explicitly or implicitly via use of C<rand()> prior to calling srand(). This is implemented in such a way that calling C<srand()> with no arguments in forks or subthreads (again explicitly or implicitly) will receive their own seed but the seeds they receive will be repeatable. This is intended for debugging and perl development performance testing, and for running the test suite consistently. It is documented that the exact seeds used to initialize the random state are unspecified, and that they may change between releases or even builds. The only guarantee provided is that the same perl executable will produce the same results twice all other things being equal. In practice and in core testing we do expect consistency, but adding the tightest set of restrictions on our commitments seemed sensible. The env var is ignored when perl is run setuid or setgid similarly to the C<PERL_INTERNAL_RAND_SEED> env var.
* Document C<local *STDOUT> as an alternative to C<select ... select>James E Keenan2022-08-101-0/+28
| | | | | | | | | | | | | | | If one needs to temporarily "capture" the output of C<print>, for example as part of a unit test, the classic "obvious" approach has been to use C<select> before and afterwards, to set a different default output handle and the restore the previous handle. If one is already in the mindset of C<select>, it might not be obvious that C<local *STDOUT> is alternative way to achieve the underlying goal, and might be clearer and more robust. Hence add it as a suggestion in the C<select> documentation. For: https://github.com/Perl/perl5/pull/19225; reconciling different approaches developed by @nwc10 and @leonerd.
* perlfunc - correct argument terminology for dbmopenDan Book2022-08-021-1/+1
| | | The MODE argument was renamed to MASK in 5.6, but later verbiage was added that calls it MODE again. Change the reference to MASK for consistency.
* point out that non-permission bits for mkdir's mode are non-portableTony Cook2022-06-271-0/+2
| | | | | | | In particular the sticky bit may or may not be set by the system mkdir() implementation. Fixes #12082
* Put back the words about no VERSION not undoing feature bundles, which got ↵Paul "LeoNerd" Evans2022-04-231-0/+5
| | | | lost in the earlier reärrangement
* Replace 'use strict; use warnings;' with 'use VERSION' in docs code examplesPaul "LeoNerd" Evans2022-04-231-3/+3
|
* Replace docs examples of 'use NUMBER' with proper v-stringsPaul "LeoNerd" Evans2022-04-231-8/+8
|
* Split docs for 'use VERSION' into its own section of perlfunc.podPaul "LeoNerd" Evans2022-04-231-47/+60
| | | | Also add more wording
* Fix typos in perlfuncSteve Hay2022-04-201-2/+2
|
* Doc changes to reflect that perl might not support taintNeil Bowers2022-04-201-1/+1
| | | | | | | | The central doc change is in perlsec.pod. This not only explains that you can build a perl that doesn't support taint, but shows how you can check whether your perl supports taint or not. The other doc changes are mainly to note that taint might not be supported, and to refer the reader to perlsec for more details.
* perlfunc: Fix readline typoMagnus Woldrich2022-04-171-1/+1
|
* Add the new flow-control keywords to perlfunc.podPaul "LeoNerd" Evans2022-04-041-5/+63
|
* (perl #128245) make it obvious :encoding uses PerlIO::encodingTony Cook2022-03-201-0/+1
| | | | rather than encoding.pm
* Revert "Fix GH Issue #19472: read warnings from open($fh,">",\(my $x))"Yves Orton2022-03-141-10/+2
| | | | | | | This reverts commit 8b03aeb95ab72abdb2fa40f2d1196ce42f34708d. This is causing BBC breakage, and its unimport and grey zone enough that we can pick it up in 5.37 when we have more time to deal with it.
* Fix GH Issue #19472: read warnings from open($fh,">",\(my $x))Yves Orton2022-03-071-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | We produce all kinds of warnings if someone opens a scalar reference that is undef. Prior to this we handled write operations ok, at least in blead, but read operations would produce a plethora of warnings. To me this analogous to treating an undef var as hash and trying to read from it, we autovivify the undef var to be a hash. So in this case we should just "autovivify" the referenced scalar to be an empty string. Eg. before this patch: ./perl -Ilib -wle'open my $fh,"+>", \(my $v); my @x=<$fh>; print 0+@x' Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. 0 After it: ./perl -Ilib -wle'open my $fh,"+>", \(my $v); my @x=<$fh>; print 0+@x' 0
* Add a pod sort sample with function signatureNicolas R2022-01-201-0/+8
| | | | | | GH #19344 Provide a sample for sort using function signature.
* Change pack U behavior for EBCDICKarl Williamson2021-12-281-1/+4
| | | | | | | | | | This effectively reverts 3ece276e6c0. It turns out this was a bad idea to make U mean the non-native official Unicode code points. It may seem to make sense to do so, but broke multiple CPAN modules which were using U the previous way. This commit has no effect on ASCII-platform functioning.
* feature updates: tweaks from code reviewRicardo Signes2021-11-021-1/+1
|
* perlfunc: note that bareword open is now often forbiddenRicardo Signes2021-11-021-1/+5
|
* perlfunc 'ref' and UNIVERSAL: document isa operator alternativeDan Book2021-08-221-1/+3
|
* Document v5.35 warnings-on-by-defaultBen Cornett2021-08-151-9/+10
|