Hi monks,

Any thoughts regarding this error:

Type of arg 1 to Try::Tiny::catch must be block or sub {} (not referen +ce constructor)

I'm not sure what to make of it. I don't get the error on my macOS system (v5.18.2) but I first saw it tonight when I switched to running same code on Windows (v5.28.1 Strawberry Distro) and w/ ActiveState distro as well.

I'm getting the error consistently through my code, including in modules and script -- wherever try {} catch {}; is used, even if I gut the subroutine of all code except for an empty try / catch block. But oddly, no issue when I try the same in a standalone do nothing script.

Any advice appreciated!

Thanks,

-Roland.

2019-01-06 Athanasius added paragraph and code tags


In reply to Try::Tiny complaining catch must be block or sub {} (not reference constructor) by hotshoe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.