Skip Menu |

This queue is for tickets about the Future-AsyncAwait CPAN distribution.

Report information
The Basics
Id: 131493
Status: rejected
Priority: 0/
Queue: Future-AsyncAwait

People
Owner: Nobody in particular
Requestors: skaji [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Future::AsyncAwait does not work with "-async" word
The following code works: ``` use strict; use warnings; sub foo { warn "[@_]\n" } foo -async; ``` But, if I add "use Future::AsyncAwait", it won't work. That is, ``` use strict; use warnings; use Future::AsyncAwait; sub foo { warn "[@_]\n" } foo -async; ``` does not work: ``` ❯ perl test.pl Expected async to be followed by sub at test.pl line 7. ``` P.S. I originally found this with Mojolicious https://github.com/mojolicious/mojo/issues/1461
Yeah there's not a lot that can be done about that. The way the perl parser plugins work means that the `async` parser doesn't know it has a hyphen in front of it, most annoyingly. As this is for the Mojo stuff I think the proposed solution there is to rename the feature to something like -async_await so this problem wouldn't come up. -- Paul Evans