On Oct 12, 10:40*pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Sherm Pendley <sherm.pend...@gmail.com>:
>
> > andrey the giant <andrey....@gmail.com> writes:
>
> > > * * try {
> > > * * * * sendmail( $email, { from => 'postmas...@example.com' } );
> > > * * * * $ret = 1;
> > > * * }
> > > * * catch { $ret = 2; $err = "$_"; }
>
> > You're missing a semicolon after that catch block.
A subtle issue completely overlooked by one fluent in primarily C/C++/
Java.
>
> > The above is actually two anonymous sub references being passed to a
> > try() method via indirect object syntax (see 'perldoc perlobj') to mimic
> > the creation of new language syntax.
>
> No it's not. It parses as (and could in fact be written as)
>
> * * try( sub { ... }, catch( sub { ... } ) )
>
> where 'catch' is a subroutine that packages up the subref so 'try' knows
> what it is.
>
> > But, code blocks don't normally
> > require semicolons after them, and your editor probably isn't aware
> > that this one does.
>
Ugh, I'm so used to C/C++/Java I totally missed the semicolon after
the catch in the cpan docs for Email::Sender::Simple

And I thought C++ templates gave cryptic error messages
Everything works now.
Thanks to everybody.