# we've not yet verified that use works.
# use strict;
-print "1..74\n";
+print "1..75\n";
my $test = 0;
sub failed {
is $::{"_<doggo"}[85], " labadalabada()\n",
'subsequent #line 42 "foo" in a string eval updates @{"_<foo"}';
}
+
+# Modifying ${"_<foo"} should not stop lines from being retained.
+{
+ local $^P = 0x400|0x100|0x10;
+ eval <<'end';
+#line 42 "copfilesv-modification"
+ BEGIN{ ${"_<copfilesv-modification"} = \1 }
+#line 52 "copfilesv-modified"
+ abcdefg();
+end
+ is $::{"_<copfilesv-modified"}[52], " abcdefg();\n",
+ '#line 42 "foo" in a str eval is not confused by ${"_<foo"} changing';
+}
if (t - s > 0) {
const STRLEN len = t - s;
- if (!PL_rsfp && !PL_parser->filtered) {
+ GV * const cfgv = CopFILEGV(PL_curcop);
+
+ if (cfgv && !PL_rsfp && !PL_parser->filtered) {
/* must copy *{"::_<(eval N)[oldfilename:L]"}
* to *{"::_<newfilename"} */
/* However, the long form of evals is only turned on by the
debugger - usually they're "(eval %lu)" */
- SV *const temp_sv = CopFILESV(PL_curcop);
- const char *cf;
- STRLEN tmplen;
+ const char *cf = GvNAME(cfgv)+2;
+ STRLEN tmplen = GvNAMELEN(cfgv)-2;
char smallbuf[128];
char *tmpbuf;
GV **gvp;
STRLEN tmplen2 = len;
-
- if (temp_sv) {
- cf = SvPVX(temp_sv);
- tmplen = SvCUR(temp_sv);
- } else {
- cf = NULL;
- tmplen = 0;
- }
-
if (tmplen + 2 <= sizeof smallbuf)
tmpbuf = smallbuf;
else