I am using mod-perl. I am under such a impression that our variable will not be created for every execution. i.e. If I create an hash variable as our then that varible will be created once and will remain in memory cache of apache for subsequent run.
So my question is will there be any difference in execution speed for below two in mod-perl?
Module1
....
....
our %myhash = qw ( list of key value );
...
....
sub fun() {
if(exists $myhash{'key'}) {
...................
return ;
}
and
Module2
.....
.....
sub fun() {
my %myhash = qw ( list of key value );
if(exists $myhash{'key'}) {
...................
return ;
}
Which one is better in term of speed of execution on mod-perl if I am invoking this function once for each run ?