in reply to Re^4: pass code block to function (PROTOTYPES)
in thread pass code block to function (PROTOTYPES)

But why is catch executed before try ?
Because perl5 doesn't have lazy evaluation. If you call a function, perl will evaluate all its arguments. And since catch {/phooey/ and print "unphooey\n"} is one of the arguments of try, catch is called first. Which is why it's important that catch just returns its first argument, not evaluates it. And that's why you're getting the warning.