Skip Menu |

This queue is for tickets about the Switch CPAN distribution.

Report information
The Basics
Id: 24027
Status: open
Priority: 0/
Queue: Switch

Owner: Nobody in particular
Requestors: MichaelRWolf [...]

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

Subject: regexp captures not available in case body
text/x-perl 330b
#! /usr/bin/perl use warnings; use Switch; $data = 'catch 22'; switch ($data) { case qr/catch (\d+)/ { print "I know my gross situation: $data\n"; print "My parsed situation is unknown: $1\n"; warn 'Matched, but not captured' unless defined $1; } else { warn "$data is unrecognized\n"; } }
Download (untitled) / with headers
text/plain 143b
At the very least, could you document that regexp captures are *not* expected to work? That could help some future users from having problems.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to