my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 11;
# number of tests in section 4
-my $hmb_tests = 35;
+my $hmb_tests = 37;
my $tests = $bas_tests + $num_tests + $bug_tests + $hmb_tests;
close HASH or die "Could not close: $!";
is cat('Op_write.tmp'), "3\n", 'anonymous hashes';
+open(HASH2, '>Op_write.tmp') || die "Can't create Op_write.tmp";
+format HASH2 =
+@<<<
++{foo=>"bar"}
+.
+write HASH2;
+close HASH2 or die "Could not close: $!";
+is cat('Op_write.tmp'), "HASH\n", '+{...} is interpreted as anon hash';
+
+# Anonymous hashes
+open(BLOCK, '>Op_write.tmp') || die "Can't create Op_write.tmp";
+format BLOCK =
+@<<< @<<<
+{foo=>"bar"} # this is a block, not a hash!
+.
+write BLOCK;
+close BLOCK or die "Could not close: $!";
+is cat('Op_write.tmp'), "foo bar\n", 'initial { is always BLOCK';
+
# pragmata inside argument line
open(STRICT, '>Op_write.tmp') || die "Can't create Op_write.tmp";
format STRICT =
if (SvCUR(stuff)) {
PL_expect = XSTATE;
if (needargs) {
+ const char *s2 = s;
+ while (*s2 == '\r' || *s2 == ' ' || *s2 == '\t' || *s2 == '\f'
+ || *s2 == 013)
+ s2++;
+ if (*s2 == '{') {
+ start_force(PL_curforce);
+ PL_expect = XTERMBLOCK;
+ NEXTVAL_NEXTTOKE.ival = 0;
+ force_next(DO);
+ }
start_force(PL_curforce);
NEXTVAL_NEXTTOKE.ival = 0;
force_next(FORMLBRACK);