minimalist icon indicating copy to clipboard operation
minimalist copied to clipboard

Workaround for given-when bug

Open begriffs opened this issue 2 years ago • 1 comments

On perl v5.36 I ran into a bug that took me a while to track down. The given() construct erases its argument after mixing the if statements with the when() statements.

I don't expect you want to accept this pull request as-is (there's probably a more elegant way to do it), but I did want to send it to you in case you or other people got confused why list commands like subscribe foo fail.

begriffs avatar Oct 23 '23 01:10 begriffs

I don't do much perl nowadays, but I remember back in my head that the given-when construct has some strange properties. So a rewrite using plain if-elsif would probably be the cleanest solution. I would be happy to merge a change eliminating the given-when statements.

madroach avatar Oct 24 '23 09:10 madroach