P
pacmac
Hello All,
I'm trying to understand someone else's code. It's a mod_perl
PerlAccessHandler.
I'm not sure what's accomplished by "our" scoping an already-our-
scoped variable when passed as an argument to a subroutine. See the
way check_pwd() is called below. Does doing this make a copy? I don't
get it.
Can someone please enlighten me?
PM
package myControl;
use strict;
use [typical Apache2 modules];
our $PWD_SECRET = '128XYZ345';
sub handler {
my $r = shift;
...
my ($stat, $msg) = check_pwd($r, our $PWD_SECRET);
...
}
sub check_pwd {
my $r = shift;
my $secret = shift;
... do stuff ...
return (1, 'OK');
}
I'm trying to understand someone else's code. It's a mod_perl
PerlAccessHandler.
I'm not sure what's accomplished by "our" scoping an already-our-
scoped variable when passed as an argument to a subroutine. See the
way check_pwd() is called below. Does doing this make a copy? I don't
get it.
Can someone please enlighten me?
PM
package myControl;
use strict;
use [typical Apache2 modules];
our $PWD_SECRET = '128XYZ345';
sub handler {
my $r = shift;
...
my ($stat, $msg) = check_pwd($r, our $PWD_SECRET);
...
}
sub check_pwd {
my $r = shift;
my $secret = shift;
... do stuff ...
return (1, 'OK');
}