@INC = '../lib';
}
-print "1..53\n";
+print "1..54\n";
@A::ISA = 'B';
@B::ISA = 'C';
test(do { eval '$e = bless {}, "E"; $e->foo()';
$@ =~ /^\QCan't locate object method "foo" via package "E" (perhaps / ? 1 : $@}, 1);
+# This is actually testing parsing of indirect objects and undefined subs
+# print foo("bar") where foo does not exist is not an indirect object.
+# print foo "bar" where foo does not exist is an indirect object.
+eval { sub AUTOLOAD { "ok ", shift, "\n"; } };
+print nonsuch(++$cnt);
@INC = '../lib';
}
use warnings;
-print "1..57\n";
+print "1..58\n";
# XXX known to leak scalars
{
print "# x = '@b'\n";
print !$def ? "ok 57\n" : "not ok 57\n";
}
+
+# Bug 19991001.003
+{
+ sub routine { "one", "two" };
+ @a = sort(routine(1));
+ print "@a" eq "one two" ? "ok 58\n" : "not ok 58\n";
+}
/* If not a declared subroutine, it's an indirect object. */
/* (But it's an indir obj regardless for sort.) */
- if ((PL_last_lop_op == OP_SORT ||
- (!immediate_paren && (!gv || !GvCVu(gv)))) &&
+ if ( !immediate_paren && (PL_last_lop_op == OP_SORT ||
+ ((!gv || !GvCVu(gv)) &&
(PL_last_lop_op != OP_MAPSTART &&
- PL_last_lop_op != OP_GREPSTART))
+ PL_last_lop_op != OP_GREPSTART))))
{
PL_expect = (PL_last_lop == PL_oldoldbufptr) ? XTERM : XOPERATOR;
goto bareword;