develooper Front page | perl.perl5.porters | Postings from May 2003

Switch problem

Thread Next
H.Merijn Brand
May 9, 2003 02:47
Switch problem
Message ID:
I have a script that starts like

--8<--- v-- = perl-5.8.0 with defined or patches

# Aanmaken van fixed-record-bestand voor Bureau Onderzoek en
# Statistiek (BOS) vanuit p-file (mb_sel).
# %W%	[%E%]

use strict;
use warnings;

use Switch;

print STDERR "[BOS392 2.0]\n";
sub usage ()
    print STDERR
	"usage: bos392 [-v] [p-file [o-file [l-file]]]\n",

And I get the error

bev a5:/pro/tu/bev/3gl/tools/0392 151 > perl -c
syntax error at line 72, near ") {"
syntax error at line 196, near "}" had compilation errors.
Exit 255
bev a5:/pro/tu/bev/3gl/tools/0392 152 >

Now I change the sequence:

use strict;
use Switch;
use warnings;

And get

bev a5:/pro/tu/bev/3gl/tools/0392 152 > perl -c
Bad switch statement (problem in the code block?) near line 409
Exit 255
bev a5:/pro/tu/bev/3gl/tools/0392 153 >

But strangely

use strict;
use Switch;
#use warnings;

ALSO yields that message, as does

#!/pro/bin/perl -w

use strict;
use Switch;
#use warnings;

Removing the line '#use warnings;' gets me back to the first error

Any thoughts?

H.Merijn Brand        Amsterdam Perl Mongers (
using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
  WinNT 4, Win2K pro & WinCE 2.11.  Smoking perl CORE:
send smoke reports to:, QA:

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About