@@ -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,39 @@ 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 $version is not NULL, sets it as C<$VERSION>.
8261+
8262+ It combines former C<package> and C<package_version> into single call.
8263+
8264+ =cut
8265+ */
8266+
8267+ void
8268+ Perl_package (pTHX_ OP *name, OP *version)
8269+ {
8270+ PERL_ARGS_ASSERT_PACKAGE;
8271+
8272+ S_set_package_name (aTHX_ name);
8273+ if (version)
8274+ S_set_package_version (aTHX_ version);
8275+ }
8276+
82578277/* Extract the first two components of a "version" object as two 8bit integers
82588278 * and return them packed into a single U16 in the format of PL_prevailing_version.
82598279 * This function only ever has to cope with version objects already known
@@ -16846,7 +16866,7 @@ Perl_subsignature_append_positional(pTHX_ PADOFFSET padix, OPCODE defmode, OP *d
1684616866 signature->next_argix++;
1684716867
1684816868 if(!padix && !defexpr)
16849- /* This param has no var and no defaulting expression. There's
16869+ /* This param has no var and no defaulting expression. There's
1685016870 * nothing else for us to do here.
1685116871 */
1685216872 return;
0 commit comments