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

Switch problem

Thread Next
From:
H.Merijn Brand
Date:
May 9, 2003 02:47
Subject:
Switch problem
Message ID:
20030509113944.EB7B.H.M.BRAND@hccnet.nl
I have a script that starts like

--8<--- v-- = perl-5.8.0 with defined or patches
#!/pro/bin/perl

# 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",
-->8---

And I get the error

bev a5:/pro/tu/bev/3gl/tools/0392 151 > perl -c bos392.pl
syntax error at bos392.pl line 72, near ") {"
syntax error at bos392.pl line 196, near "}"
bos392.pl 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 bos392.pl
Bad switch statement (problem in the code block?) near bos392.pl 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 (http://amsterdam.pm.org/)
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: smokers@perl.org
http://archives.develooper.com/daily-build@perl.org/   perl-qa@perl.org
send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About