@@ -6100,7 +6100,7 @@ Perl_newBINOP(pTHX_ I32 type, I32 flags, OP *first, OP *last)
61006100 ? 2 /* Otherwise, minimum of 2 hex digits */\
61016101 : NUM_HEX_CHARS(num)))))))
61026102
6103- /* To make evident, Configure with `-DDEBUGGING`, build, run
6103+ /* To make evident, Configure with `-DDEBUGGING`, build, run
61046104 * `./perl -Ilib -Dy t/op/tr.t`
61056105 */
61066106void
@@ -8223,13 +8223,11 @@ Perl_newPVOP(pTHX_ I32 type, I32 flags, char *pv)
82238223 return CHECKOP(type, pvop);
82248224}
82258225
8226- void
8227- Perl_package (pTHX_ OP *o)
8226+ STATIC void
8227+ S_set_package_name (pTHX_ OP *o)
82288228{
82298229 SV *const sv = cSVOPo->op_sv;
82308230
8231- PERL_ARGS_ASSERT_PACKAGE;
8232-
82338231 SAVEGENERICSV(PL_curstash);
82348232 save_item(PL_curstname);
82358233
@@ -8243,17 +8241,41 @@ Perl_package(pTHX_ OP *o)
82438241 op_free(o);
82448242}
82458243
8246- void
8247- Perl_package_version ( pTHX_ OP *v )
8244+ STATIC void
8245+ S_set_package_version ( pTHX_ OP *v )
82488246{
82498247 U32 savehints = PL_hints;
8250- PERL_ARGS_ASSERT_PACKAGE_VERSION;
8248+
82518249 PL_hints &= ~HINT_STRICT_VARS;
82528250 sv_setsv( GvSV(gv_fetchpvs("VERSION", GV_ADDMULTI, SVt_PV)), cSVOPx(v)->op_sv );
82538251 PL_hints = savehints;
82548252 op_free(v);
82558253}
82568254
8255+ /*
8256+ =for apidoc package
8257+
8258+ package ($name, $version)
8259+
8260+ Function sets current stash name and if not NULL, sets its C<$VERSION>.
8261+
8262+ It combines former C<package> and C<package_version> into single call.
8263+
8264+ Available since: v5.44
8265+
8266+ =cut
8267+ */
8268+
8269+ void
8270+ Perl_package (pTHX_ OP *name, OP *version)
8271+ {
8272+ PERL_ARGS_ASSERT_PACKAGE;
8273+
8274+ S_set_package_name (aTHX_ name);
8275+ if (version)
8276+ S_set_package_version (aTHX_ version);
8277+ }
8278+
82578279/* Extract the first two components of a "version" object as two 8bit integers
82588280 * and return them packed into a single U16 in the format of PL_prevailing_version.
82598281 * This function only ever has to cope with version objects already known
@@ -16846,7 +16868,7 @@ Perl_subsignature_append_positional(pTHX_ PADOFFSET padix, OPCODE defmode, OP *d
1684616868 signature->next_argix++;
1684716869
1684816870 if(!padix && !defexpr)
16849- /* This param has no var and no defaulting expression. There's
16871+ /* This param has no var and no defaulting expression. There's
1685016872 * nothing else for us to do here.
1685116873 */
1685216874 return;
0 commit comments