Thanks monks!

False alarm. I needed to address the experimental push by casting my reference to array w/ @{}. It's in a different code block from try / catch block so I assumed the errors were unrelated (and they are) but fixing the one addresses the try / catch "issue".

Experimental push on scalar is now forbidden at [mymodule] line 474, n +ear "$asset;" Type of arg 1 to Try::Tiny::catch must be block or sub {} (not referen +ce constructor) at [mymodule] line 680, near "};" Type of arg 1 to Try::Tiny::try must be block or sub {} (not reference + constructor) at [mymodule] line 680, near "};"

I created short code sample below that illustrates the behavior in action (w/ the fix). Still not at all clear to me how the one (experimental push issue) affects the other, but I'm unblocked from making progress. Any thoughts?

use strict; use warnings; use 5.006; use Try::Tiny; my @array = (); my $array_ref = \@array; push $array_ref, 'test'; # bugbug #push @{$array_ref}, 'test'; # <== change prev line to be like this test(); sub test { try { my $a = 1/0; } catch { print 'awww, snap!'; }; 1; } 1; __END__

In reply to Re^2: Try::Tiny complaining catch must be block or sub {} (not reference constructor) by hotshoe
in thread 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.