J
Joe Gottman
I am having problem using Switch with capturing regexes. For instance,
consider the following code:
use Switch;
my $foo = 'foo';
switch ($foo) {
case /(.*)/ {print "Worked. Captured text = '$1'\n";}
else {print "Didn't work\n";}
}
The output I get is
Worked. Captured text = ''
Thus, the regular expression is matching as expected, but no data is being
captured.
Joe Gottman
consider the following code:
use Switch;
my $foo = 'foo';
switch ($foo) {
case /(.*)/ {print "Worked. Captured text = '$1'\n";}
else {print "Didn't work\n";}
}
The output I get is
Worked. Captured text = ''
Thus, the regular expression is matching as expected, but no data is being
captured.
Joe Gottman