[Israel.pm] Can anyone explain my mistake ?

Berler Chanan chananb at centerity.com
Wed Jun 10 02:47:47 PDT 2009


Hi All

I am running this simple foreach loop:
why do I get lv_num = <null> ? am I missing something ?
Thanks
Chanan


my @arr = (1,2,3,4,5);

foreach $lv_num (@arr)
{
   print "Found $lv_num\n";
   last if ($lv_num == 3);
}

print "lv_num = $lv_num\n";




More information about the Perl mailing list