J
Joe Gottman
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?
Joe Gottman
#!/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?
Joe Gottman