John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

When I removed the use that exported dies_ok, I missed one of the uses in the code, but to my surprise it compiled and ran OK. Rather, it ran until ordinal threw an exception, so I don't know what it was going to do with the result, or produce another error when it tried to do something with the bareword dies_ok.

dies_ok { HTML::EntityReference::ordinal('CapitalDifferentialD', ':foo +XX') } $test_name;
So if strict and warnings are both in effect, and dies_ok is not imported with the prototype it was being called with before, what does this syntax mean?

Replies are listed 'Best First'.
Re: What does this syntax mean?
by GrandFather (Saint) on May 14, 2011 at 05:04 UTC

    Output from B::Deparse is interesting:

    { do { HTML::EntityReference::ordinal('CapitalDifferentialD', ':fooXX +') }->dies_ok($test_name); }
    True laziness is hard work
Re: What does this syntax mean?
by ikegami (Patriarch) on May 14, 2011 at 05:15 UTC

    It's an indirect method call (METHOD CLASS_OBJECT ARGS), where the class/object expression in in curlies. You're familiar with a special case of this:

    print { STDOUT } foo;