J
John
Hi all,
I am trying to create a module. and I have a question about the scope
of the variables.
lets say,
use strict;
sub one {
my ($rvalue) = @_; # here I define a variable
for my $i (0..$#$rvalue){ # here I define a local
# variable $i and I use it
# do something
}
}
sub second {
my ($rvalue) = @_; # on this second sub $rvalue
# is a new one or I carry it
# as the first one
for my $i (0..$#$rvalue){ # now the same case, $i was
# already defined and if the
# scope is just its
# own subsroutine, now this
# $i is something copletely
# new. Am I right?
# do something else
}
}
# Thanks for your help
# John
I am trying to create a module. and I have a question about the scope
of the variables.
lets say,
use strict;
sub one {
my ($rvalue) = @_; # here I define a variable
for my $i (0..$#$rvalue){ # here I define a local
# variable $i and I use it
# do something
}
}
sub second {
my ($rvalue) = @_; # on this second sub $rvalue
# is a new one or I carry it
# as the first one
for my $i (0..$#$rvalue){ # now the same case, $i was
# already defined and if the
# scope is just its
# own subsroutine, now this
# $i is something copletely
# new. Am I right?
# do something else
}
}
# Thanks for your help
# John