W
worlman385
if I call a perl function 26 times,
are the variables $decode, $flag global variables?
I thought they are local variables like methods in Java, once the
function returns, $decode , $flag will get destroy.
But when i look into komodo debugger they are global variables.
How can i use them as local variables like method variables in Java?
Thanks
for ( $i = 1; $i <= 26; $i++)
{
decode($i);
}
sub decode
{
$decode = "";
$flag = $_[0];
if ( $flag != undef ) {
$data_file="brute.txt";
} else {
$data_file="encoded.txt";
$flag = 3;
}
open(DAT, $data_file) || die("Could not open encoded.txt!");
@raw=<DAT>;
close(DAT);
}
are the variables $decode, $flag global variables?
I thought they are local variables like methods in Java, once the
function returns, $decode , $flag will get destroy.
But when i look into komodo debugger they are global variables.
How can i use them as local variables like method variables in Java?
Thanks
for ( $i = 1; $i <= 26; $i++)
{
decode($i);
}
sub decode
{
$decode = "";
$flag = $_[0];
if ( $flag != undef ) {
$data_file="brute.txt";
} else {
$data_file="encoded.txt";
$flag = 3;
}
open(DAT, $data_file) || die("Could not open encoded.txt!");
@raw=<DAT>;
close(DAT);
}