[ale] perl question

Geoffrey Myers lists at serioustechnology.com
Mon Jan 16 14:45:20 EST 2012


Okay, so why is it that $foo is empty inside the sub bar() ??


my $bar;
my $foo;


foreach $foo ("test", "another") {

     $bar = $foo;
     print "before: bar <$bar> foo <$foo>\n";
     bar();
}


sub bar
{
     print "in bar(): bar <$bar> foo <$foo>\n";
}

-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list