Wood Family wrote:
> I'm reading from a 1996 version of "Programming Perl" - not sure if that's
> relevant or not. My problem is related to calling subroutines with a list of
> arguments:
> sub some_sub ($a, $b) {
> ...
> }
> $a = "hello"; $b = " world";
> some_sub ($a, $b); # Tells me I have malformed parameters whereas
> # &some_sub ($a, $b) works fine.
>
> The book informs me that that the former version should work OK. Am I
> missing something?
1) $a and $b are bad choices since they are used for sorting and such, but
will work.
2) use 'use strict;' on all your code.
3) try more like this since you have illegal prototypes on yours:
use strict;
my $a = "hello";
my $b = "world";
some_sub ($a, $b);
sub some_sub {
my ($a, $b) = @_;
# ...
}
__END__
--
,-/- __ _ _ $Bill Luebkert ICQ=162126130
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs