summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* AIX: skip some locale testsTony Cook2023-05-171-8/+14
| | | | | | | | | | These tests fail on the EN_US.UTF-8 locale. Some fail due to a bug fixed in later AIX (lib/locale.t, t/run/locale.t) and the other due to an apparent bug in the locale itself. https://perl5.test-smoke.org/report/5034327
* Remove duplicate "the" in commentsElvin Aslanov2023-05-031-1/+1
| | | | Fix spelling on various files pertaining to core Perl.
* Bump version for 5.37.12Steve Hay2023-04-201-1/+1
|
* test infra - Under -DNO_TAINT_SUPPORT skip tests that use -T or -tYves Orton2023-04-021-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses a collection of heuristics to skip test files which would die on a perl compiled with -DNO_TAINT_SUPPORT but without -DSILENT_NO_TAINT_SUPPORT. -DNO_TAINT_SUPPORT disables taint support in a "safe" way, such that if you try to use taint mode with the -t or -T options an exception will be thrown informing you that the perl you are using does not support taint. (The related setting -DSILENT_NO_TAINT_SUPPORT disables taint support but causes the -t and -T options to be silently ignored.) The error from using -t and -T is thrown very early in the process startup and there is no way to "gracefully" handle it and convert it into something else, for instance to skip a test file which contains it. This patch generally fixes our code to skip these tests. * Make t/TEST and t/harness check shebang lines and use filename checks to filter out tests that use -t or -T. Primarily this is the result of checking their shebang line, but some cpan/ files are excluded by name, either from a very short list of exclusions, or because their file name contains the word "taint". Non-cpan test files were fixed individually as noted below. * test.pl - make run_multiple_progs() skip test cases based on the switches that are part of the test definition. This function is used in a great deal of our internal tests, so it fixes a lot of tests in one go. * XS-APITest/t/call.t, t/run/switchDX.t, lib/B/Deparse.t - Skip a small set of tests in each file.
* Config.pm - add taint_disabled and taint_support to %ConfigYves Orton2023-04-021-0/+33
| | | | | | | | | | | | | This adds 'taint_disabled' and 'taint_support' to Config.pm and %Config. This way people can use them while we decide what to do about the changes to Configure. We shouldn't need to have Configure changed to export status variables like this in Config.pm See: https://github.com/Perl-Toolchain-Gang/Test-Harness/pull/118 and: https://github.com/Perl/perl5/pull/20972 for related work that is stalled because we have not decided what to do about these variables.
* Deparse: fix scalar-proto sub calls without argumentsLukas Mai2023-04-022-54/+156
| | | | | | | | | - fix (;$) - remove infinite loops from check_proto() - implement (+) - fix (\@) and (\%) Fixes GH #20989.
* [doc] clarify behavior of File::Copy::cp re: permissionsLukas Mai2023-03-241-4/+7
| | | | | | In particular, explain that "preserve permission bits like cp" means the default behavior of /bin/cp, not "cp -p" or "cp --preserve", so the umask still applies.
* don't set a special filetype for generated .gitignoreLukas Mai2023-03-241-2/+2
| | | | | | | Previously it would default to Perl, which happens to produce the right comment character ("#"), but results in nonsensical syntax highlighting. Now we set $lang to the special value 'None', which still produces read-only declarations, but doesn't force a mode/filetype on editors.
* fix incorrect vi filetype declarations in generated filesLukas Mai2023-03-246-8/+8
| | | | | Vim's filetype declarations are case sensitive. The correct types for Perl, C, and Pod are perl, c, and pod, respectively.
* Bump version to 5.37.11, update Module-CoreListYves Orton2023-03-211-1/+1
| | | | | | | | | | Module-CoreList was synced with CPAN and had its version in Porting/Maintainers.pl updated. Module-CoreList was also updated by running: ./perl -Ilib Porting/corelist.pl cpan With some manual fixups afterwards to make it pass test.
* warnings.pm - add deprecated::version_downgrade categoryYves Orton2023-03-181-18/+25
| | | | | This also fixes the version_downgrade to show the correct version that version downgrades will be removed in.
* warnings.pm - add deprecated::goto_construct categoryYves Orton2023-03-181-98/+103
| | | | | This category applies to attempts to goto the internals of a block construct.
* warnings.pm - add deprecated::delimiter_will_be_paired categoryYves Orton2023-03-181-15/+22
| | | | | | Some delimiters are considered deprecated because in the future they will be used as part of a paired delimiter. This adds a new category for these cases.
* warnings.pm - add deprecated::apostrophe_as_package_separator as new ↵Yves Orton2023-03-181-157/+164
| | | | | | | deprecation category This category is about use of apostrophe as a package separator, eg for things like "Test::More::isn't()".
* warnings.pm - support deprecated::unicode_property_name categoryYves Orton2023-03-181-89/+96
| | | | | | This category is only used in the regex engine, we should be able to disable it specifically, as it seems like we will never actually remove demove support for the things it warns about.
* warnings.pm - add deprecated::dot_in_inc warings categoryYves Orton2023-03-181-45/+52
| | | | | Instead of using a generic warnings category switch to fine grained control.
* warnings.pm - support deprecated::smartmatch categoryYves Orton2023-03-181-5/+12
| | | | | | | | | | | | | | | | Currently we seem to lack a way to have a subcategory under deprecated. It seems reasonable to me that people might want to disable a specific subcategory warning while leaving the rest in place. This patch allows that. Note that both no warnings "deprecated"; and no warnings "deprecated::smartmatch"; work to disable the warning. Deprecated warnings shouldn't be "all or nothing", they should be specific and targetted.
* eval_sv(): call pp_entereval() via runopsDavid Mitchell2023-02-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the previous commit which did it for amagic_call() and call_sv(), this commit makes executing the faked-up OP_ENTEREVAL be executed as part of the runops loop rather than as a separate call. This is to allow shortly fixing up for a reference-counted stack. (CALLRUNOPS() will reify the stack if necessary, while the raw call to pp_entereval() won't fix up the stack unless its part of the runops loop too.) However, this is a bit more complex than call_sv() etc in that there is a good reason for calling pp_entereval() separately. The faked up OP_ENTEREVAL has its op_next set to NULL - this is the op which would normally be returned on failure of the eval compilation. By seeing whether the retuned value from pp_entereval() is NULL or not, eval_sv() can tell whether compilation failed. On the other hand, if pp_entereval() was made to be called as part of the runops loop, then the runops loop *always* finishes with PL_op set to NULL. So we can no lo longer distinguish between compile-failed and compile-succeeded-and-eval-ran-to-completion. This commit moves the entereval into the runops loop, but restores the ability to distinguish in a slightly hacky way. It adds a new private flag for OP_ENTEREVAL - OPpEVAL_EVALSV - which indicates to pp_entereval() that it was called from eval_sv(). And of course eval_sv() sets this flag on the OPpEVAL_EVALSV op it fakes up. If pp_entereval() fails to compile, then if that flag is set, it pushes a null pointer onto the argument stack before returning. Thus by checking whether *PL_stack_sp is NULL or not on return from CALLRUNOPS(), eval_sv() regains the ability to distinguish the two cases.
* Bump $VERSION in lib/feature.pm to 1.81.James E Keenan2023-02-241-1/+1
| | | | | Change is actually made in regen/feature.pl, then we run 'perl regen.pl'.
* Document that smartmatch is deprecated and will be removed in 5.42Philippe Bruhat (BooK)2023-02-251-0/+3
|
* Replace 'experimental::smartmatch' by 'deprecated' in testsPhilippe Bruhat (BooK)2023-02-252-9/+9
|
* Deprecate smartmatchPhilippe Bruhat (BooK)2023-02-251-71/+67
| | | | | Make the 'experimental::smartmatch' warning obsolete, and use 'deprecated' instead.
* Benchmark.t - sanity check for a broken times()Yves Orton2023-02-231-0/+83
| | | | | | | | If time() or times() is broken then Benchmark can infinite loop. This adds a sanity check that will die early if it appears that either are broken. This fixes the infinite loop part of GH Issue #20839
* Prefer scalar assignment to get caller's first return valueRichard Leach2023-02-225-11/+11
| | | | | | | | | | | | | | | | | | | | | | | Multiple forms of syntax can be used to obtain a package name from `caller`, which emits this as its first return value, and assign that name to a lexical scalar. The following each achieve the same result, but with varying efficiency: * `sub callme { my $package = caller(2); ...}` * `sub callme { my ($package) = caller(2); ...}` * `sub callme { my $package = (caller(2))[0]; ...}` In the first example, `pp_caller` determines only the package name and pushes it to the stack. In the other two examples, the other 10 of `caller`'s return values are calculated and pushed onto the stack, before being discarded. This commit changes non-CPAN-first instances of the latter two forms in core to the first form. Note: There is a special exception to the equivalence described above, when caller is use in list context within the DB package. Such a usage instance in regen/warnings.pl therefore remains unchanged.
* warnings::register - simplify use of callerJames Raspass2023-02-221-3/+2
| | | | | caller in scalar context does much less work so not only is this easier to read, it should be a tad faster. And for good measure, switch to the modern version declaration while bumping.
* fix "equivelent" in a few placesTony Cook2023-02-211-7/+9
| | | | Be a bit clearer that this is used for testing perl itself.
* Bump the perl version in various places for 5.37.10Karen Etheridge2023-02-201-1/+1
|
* manually triggered generated files - add file type data to modelineYves Orton2023-02-191-2/+2
| | | | so that github syntax highlights them properly
* generated files - update mode lines to specify file typeElvin Aslanov2023-02-195-10/+10
| | | | | | | | | | This updates the mode-line for most of our generated files so that they include file type information so they will be properly syntax highlighted on github. This does not make any other functional changes to the files. [Note: Commit message rewritten by Yves]
* experimental: sync with CPAN version 0.031Leon Timmermans2023-02-151-0/+1
| | | | | | | | | | | From Changes: - Fix the name of the extra_paired_delimiters feature (previously mis-documented as extra_paired_delims) - Added "stable.pm", which acts like experimental.pm only for features which have been marked non-experimental in their current form, in later version of perl.
* Field :param attributes, //= and ||= default assignmentsPaul "LeoNerd" Evans2023-02-101-1/+4
|
* Accept field VAR = EXPR on field varsPaul "LeoNerd" Evans2023-02-101-0/+7
| | | | | Allows non-constant expressions with side effects. Evaluated during the constructor of each instance.
* Initial attack at basic 'class' featurePaul "LeoNerd" Evans2023-02-104-7/+31
| | | | | | | | | | | | | Adds a new experimental warning, feature, keywords and enough parsing to implement basic classes with an empty `new` constructor method. Inject a $self lexical into method bodies; populate it with the object instance, suitably shifted Creates a new OP_METHSTART opcode to perform method setup Define an aux flag to remark which stashes are classes Basic implementation of fields. Basic anonymous methods.
* Don't test if PATHs are wrappedHåkon Hægland2023-02-071-1/+6
| | | | | | | This fixes issue #15544. If the user has PATH, or similar variables containing a list of directories separated by e.g. a colon character these can easily become lines with more than 1000 characters in a perlbug report, resulting in a test failure in lib/perlbug.t.
* UNIVERSAL.pm - Use lexical variables in SynopsisElvin Aslanov2023-01-311-11/+11
| | | | Add `my`, and name variables differently to avoid confusion.
* bump version for 5.37.9reneeb2023-01-211-1/+1
|
* Remove full stop in the 'try' feature headingDagfinn Ilmari Mannsåker2023-01-161-1/+1
| | | | None of the other headings in feature.pm have full stops.
* Correct one character typo appearing in lib/feature.pmJames E Keenan2023-01-111-2/+2
| | | | | | Since lib/feature.pm is a generated file, the actual changes are made in regen/feature.pl, followed by 'make regen' to regenerate lib/feature.pm (and then followed by 'make test_porting') to confirm.
* DBM_Filter/t - Use a private temporary directory for testsYves Orton2022-12-312-13/+26
| | | | | | I missed a parallelism issue in the DBM_Filter tests. This patch makes 01error.t and 02core.t use temporary directories for their tests so they don't collide.
* lib/DBM_filter/t/ - make test parallel safeYves Orton2022-12-267-55/+55
| | | | | | Tests were using the same filenames for each test, and if they ran at the same time, boom. Fixed them to each use their own prefix.
* Bump the perl version in various places for 5.37.8Richard Leach2022-12-201-1/+1
|
* Define OP_HELEMEXISTSOR, a handy LOGOP shortcut for HELEM existence testsPaul "LeoNerd" Evans2022-12-191-0/+4
| | | | | | | | | | | | | | | | | | This op is constructed using an OP_HELEM as the op_first and any scalar expression as the op_other. It is roughly equivalent to the following perl code: exists $hv{$key} ? $hv{$key} : OTHER except that the HV and the KEY expression are evaluated only once, and only one hv_* function is invoked to both test and obtain the value. It is therefore smaller and more efficient. Likewise, adding the OPpHELEMEXISTSOR_DELETE flag turns it into the equivalent of exists $hv{$key} ? delete $hv{$key} : OTHER
* sv.c - sv_2pv_flags: Fix double FETCH from tied overloaded scalarYves Orton2022-12-061-1/+1
| | | | | | | | | | | | | | When dealing with a tied scalar with get magic, and the FETCH method returned a blessed reference with overloading magic (with "a" magic), the tied scalar returned from the fetch was not copied prior to calling the magic function as an argument, this would then cause the get magic to be called again if the overloaded method happened to copy or otherwise use the tied scalar. The solution is to copy the reference prior to dispatching the overload call. It looks like we have been testing for the double FETCH for some time, without any good rationale, so this test merely changes things to expect the desired count.
* Document postderef_qq support for ->$#* interpolationZakariyya Mughal2022-11-301-3/+4
| | | | This was added in commit <https://github.com/Perl/perl5/commit/ff25e5dbbad6ccf83f2e2a874a3c90294ea8cb47>.
* feature.pm: Bump version numberKarl Williamson2022-11-301-1/+1
| | | | This is in preparation for the next commit
* Bump B::Deparse VERSIONPaul "LeoNerd" Evans2022-11-301-1/+1
|
* Deparse.pm: Correctly handle signature //= and ||= paramsPaul "LeoNerd" Evans2022-11-302-1/+21
|
* Recognise `//=` and `||=` syntax in signature parameter defaultsPaul "LeoNerd" Evans2022-11-261-1/+7
| | | | | | These create parameters where the default expression is assigned whenever the caller did not pass a defined (or true) value. I.e. both if it is missing, or is present but undef (or false).
* Bump the perl version in various places for 5.37.6Max Maischein2022-11-201-1/+1
|
* utf8::upgrade: Don't coerce undef argKarl Williamson2022-11-142-1/+6
| | | | This fixes GH #20419