in reply to Re: Question regarding variable scope
in thread Question regarding variable scope

Hmmmm....
sub find_paring() { my $white_player = shift;
Looks like a conflict of interest there. Can't really shift if you aren't allowing anything to be passed. Try
sub find_paring { my $white_player = shift;
I think you'll be happier.
my @a=qw(random brilliant braindead); print $a[rand(@a)];

Replies are listed 'Best First'.
Re: Re: Re: Question regarding variable scope
by Roger (Parson) on Oct 18, 2003 at 08:13 UTC
    Umm, I have to disagree with you here. The code
    sub find_parsing() { ... }
    is equivalent to
    sub find_parsing { ... }
    I always start my subroutines with sub function() (a habit from shell programming days). Strict argument prototyping is not necessary with Perl though.