David,
Wow, I can't believe I didn't think of this. You are right, this will need to be changed.
I am open to an alternate name for 'when', do you have any suggestions?
Thanks,
- Stevan
On Mar 18, 2013, at 10:51 AM, David Leadbeater via RT <bug-Promises@rt.cpan.org> wrote:
Show quoted text> Mon Mar 18 10:51:09 2013: Request 84024 was acted upon.
> Transaction: Ticket created by DGL
> Queue: Promises
> Subject: "when" syntax not valid with modern Perl syntax
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: dgl@dgl.cx
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=84024 >
>
>
> The following gives a syntax error:
>
> #!perl
> use 5.010;
> use Promises qw[ when deferred ];
> when(deferred->resolve)->then(sub { print "hi" });
>
> Using Promises::when as a workaround works. I think it should at least be
> pointed out in the docs (and maybe an alternate verb should be provided,
> ideally deprecating the abuse of "when").
>