CC: | bug-Switch [...] rt.cpan.org |
Subject: | [perl #39861] Switch module doesn't like subroutine prototypes? |
Date: | Thu, 06 Oct 2011 15:13:18 -0700 |
To: | "OtherRecipients of perl Ticket #39861":; |
From: | "Father Chrysostomos via RT" <perlbug-followup [...] perl.org> |
Forwarding to the CPAN queue....
On Sat Mar 06 09:34:24 2004, rafael wrote:
Show quoted text
> This is a bug report for perl from rafael@dat.local,
> generated with the help of perlbug 1.35 running under perl v5.9.1.
>
>
> -----------------------------------------------------------------
> [Please enter your report here]
>
> The following program doesn't work (with Switch 2.10) :
>
> #!perl
> use Switch 'perl6';
> sub foo ($) {
> my $var = shift;
> given ($var){
> when 'hej' {print "Hopp\n";}
> else {die "D'oh\n";}
> }
> }
> foo('hej');
> __END__
>
> Using another prototype for foo() makes Switch recognize properly the
> switch statement.
>
> I guess "$)" confuses slighty the source filter. (Maybe the problem
> is in Text::Balanced.)
>
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
> category=library
> severity=low
> ---
> Site configuration information for perl v5.9.1:
>
> Configured by rafael at Wed Mar 3 22:57:57 CET 2004.
>
> Summary of my perl5 (revision 5 version 9 subversion 1 patch 21538)
> configuration:
> Platform:
> osname=linux, osvers=2.4.20, archname=i686-linux
> uname='linux dat 2.4.20 #1 sun dec 1 21:25:14 cet 2002 i686
> unknown '
> config_args='-des -Dusedevel -Dprefix=/opt/perl -Doptimize=-g
> -DDEBUGGING'
> hint=recommended, useposix=true, d_sigaction=define
> usethreads=undef useithreads=undef usemultiplicity=undef
> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
> use64bitint=undef use64bitall=undef uselongdouble=undef
> usemymalloc=n, bincompat5005=undef
> Compiler:
> cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -I/usr/include/gdbm',
> optimize='-g',
> cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include
> -I/usr/include/gdbm'
> ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-
> 85)', gccosandvers=''
> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
> d_longlong=define, longlongsize=8, d_longdbl=define,
> longdblsize=12
> ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> lseeksize=8
> alignbytes=4, prototype=define
> Linker and Libraries:
> ld='cc', ldflags =' -L/usr/local/lib'
> libpth=/usr/local/lib /lib /usr/lib
> libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lc
> perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
> libc=/lib/libc-2.2.5.so, so=so, useshrplib=false,
> libperl=libperl.a
> gnulibc_version='2.2.5'
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
> cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
>
> Locally applied patches:
> DEVEL21538
>
> ---
> @INC for perl v5.9.1:
> /home/rafael/bleadperl/lib
> /opt/perl/lib/5.9.1/i686-linux
> /opt/perl/lib/5.9.1
> /opt/perl/lib/site_perl/5.9.1/i686-linux
> /opt/perl/lib/site_perl/5.9.1
> /opt/perl/lib/site_perl
> .
>
> ---
> Environment for perl v5.9.1:
> HOME=/home/rafael
> LANG=en_US
> LANGUAGE (unset)
> LD_LIBRARY_PATH (unset)
> LOGDIR (unset)
>
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/opt/perl/bin:/home/rafael/bin:/usr/local/subversion/bin:/usr/local/gcc34s/bin
Show quoted text> PERL_BADLANG (unset)
> SHELL=/bin/bash