Hi,

I have a doubt. If i create an array inside a foreach loop using `my`, is this array 
recreated
every time or every time the loop pass by i got a new array?

e.g.:
_BEGIN_
#!/usr/bin/perl
use warnings;
use strict;
my @array1 =(1,2,3,4,5,6,7,8,9);
foreach(@array1){
 my @array2 = ($_,'a','b','c','d','e'); #is a new the array reated here? or is the 
same array?
 print "$_ = @array2\n";
}
_END__

_RESULT_
1 = 1 a b c d e
2 = 2 a b c d e
3 = 3 a b c d e
4 = 4 a b c d e
5 = 5 a b c d e
6 = 6 a b c d e
7 = 7 a b c d e
8 = 8 a b c d e
9 = 9 a b c d e
_RESULT_

Thank you very much,

Rod


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to