Joe Gottman <> wrote in comp.lang.perl.misc:
> I tried to compile the following code in my Perl program:
>
> #!/usr/bin/perl
>
> use strict;
> use Switch;
>
> sub testSwitch ($)
> {
> my $param = shift;
> switch ($param) {}
> }
>
>
> I got the following error:
> syntax error at test.pl line 9, near ") {"
> syntax error at test.pl line 10, near "}"
> Execution of test.pl aborted due to compilation errors.
>
> Strangely, when I declared the function with no prototype, or replaced the
> "$" with "$;", the program compiled fine. Does anyone have any idea why
> this is happening?
That looks like a bug in the Switch module to me, though it could also
be a bug in Perl's prototyping system. It's hard to see what's going on,
because Switch.pm uses a source filter. Unless someone else has a better
idea, I'd report it.
Anno
|