Skip Menu |

This queue is for tickets about the Switch CPAN distribution.

Report information
The Basics
Id: 29622
Status: new
Priority: 0/
Queue: Switch

People
Owner: Nobody in particular
Requestors: paddor [...] gmail.com
Cc:
AdminCc:

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



Subject: comments and regular expression cases
Date: Wed, 26 Sep 2007 14:14:32 +0200
To: bug-Switch [...] rt.cpan.org
From: paddor <paddor [...] gmail.com>
Hello It's very strange. The code below does neither work with Switch 2.13 on RedHat x86_64 nor with Switch 2.10_01 on Gentoo x86_64. If I don't use a regular expression in the case statement, it works. If I remove the COMMENTED sub "h2a" at the end, it works. If I do both, it works. Show quoted text
--- code BEGIN --- #! /usr/bin/env perl use Switch; # for switch-case conditions my $usage = "This is the Usage."; switch ($ARGV[0]) { case "-f" { print "A file is read."; } case /^-/ { print $usage; } else { print "This is the else-block."; } } #sub h2a { # join '', map chr hex, split /:/, $_[0]; #}
--- code END --- Greets, paddor