Skip Menu |
Report information
Id: 39861
Status: rejected
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: rafael <rgarciasuarez [at] gmail.com>
shay <steve.m.hay [at] googlemail.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: (no value)
Type: sendToCPAN
Perl Version: (no value)
Fixed In: (no value)



Subject: Switch is confused by ($) prototype
Date: Sat, 6 Mar 2004 18:31:10 +0100
To: perlbug [...] perl.org
From: Rafael Garcia-Suarez <rgarciasuarez [...] free.fr>
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 PERL_BADLANG (unset) SHELL=/bin/bash
Subject: Switch module doesn't like subroutine prototypes?
Date: Tue, 18 Jul 2006 16:05:45 +0100
To: perlbug [...] perl.org
From: Steve Hay <steve.hay [...] uk.radan.com>
Download (untitled) / with headers
text/plain 4.6k
This is a bug report for perl from steve.hay@uk.radan.com, generated with the help of perlbug 1.33 running under perl v5.9.4. ----------------------------------------------------------------- [Please enter your report here] The following program: use Switch; sub foo($) { switch ($_[0]) { case 1 { print "OK\n" } } } foo(1); outputs the following errors: Number found where operator expected at test.pl line 2, near "case 1" (Do you need to predeclare case?) syntax error at test.pl line 2, near ") {" syntax error at test.pl line 2, near "} }" Execution of test.pl aborted due to compilation errors. If you delete the prototype on the subroutine foo() then the program prints OK as expected. (I'm using an old perlbug here, because later ones seem to do absolutely nothing on Win32.) [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=medium --- This perlbug was built using Perl v5.6.1 - Tue Apr 17 15:55:30 2001 It is being executed now by Perl v5.9.4 - Wed Jul 12 12:12:13 2006. Site configuration information for perl v5.9.4: Configured by steveh at Wed Jul 12 12:12:13 2006. Summary of my perl5 (revision 5 version 9 subversion 4) configuration: Platform: osname=MSWin32, osvers=5.1, archname=MSWin32-x86-perlio uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=undef, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -Od -MD -Zi -DDEBUGGING -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_DEBUGGING_MSTATS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-Od -MD -Zi -DDEBUGGING', cppflags='-DWIN32' ccversion='12.00.8804', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -libpath:"C:\perl5\lib\CORE" -machine:x86' libpth="C:\Program Files\Microsoft Visual Studio\VC98\lib" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl59.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -libpath:"C:\perl5\lib\CORE" -machine:x86' Locally applied patches: --- @INC for perl v5.9.4: C:/perl5/lib C:/perl5/site/lib . --- Environment for perl v5.9.4: HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\perl5\bin;U:\scripts\batch;C:\Program Files\ZipGenius 6\;C:\Program Files\Sybase\SQL Anywhere 8\win32;C:\Program Files\Sybase\Shared\win32;C:\Program Files\Sybase\SQL Anywhere 8\drivers;C:\Program Files\Sybase\Shared\Sybase Central 4.1;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\InstallShield\InstallShield 5.5 Professional Edition\Program;C:\Program Files\Subversion\bin;C:\WATCOM\BINNT;C:\WATCOM\BINW PERL_BADLANG (unset) SHELL (unset) -- ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
RT-Send-CC: bug-Switch [...] rt.cpan.org
Download (untitled) / with headers
text/plain 3.3k
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
To: dom [...] cpan.org, perlbug-followup [...] perl.org
Date: Thu, 20 Mar 2014 03:34:48 -0400
Subject: [rt.cpan.org #71512] [perl #39861] Switch module doesn't like subroutine prototypes?
From: "Alexandr Ciornii via RT" <bug-Switch [...] rt.cpan.org>
Download (untitled) / with headers
text/plain 191b


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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org