Skip Menu |
 

This queue is for tickets about the Switch CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: MichaelRWolf [...] att.net
Cc:
AdminCc:

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



Subject: regexp captures not available in case body
Subject: broken_switch.pl
Download broken_switch.pl
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 Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.