@somelist = ("1", "2", "3", "4"
;
foreach $list (@somelist)
if($list eq 4)
{open FIL, ">>1file.txt"
}
else {
(open FIL, ">>2file.txt"
}}
--------------------------
now heres the problem the program is gonna open both files 1file and 2file cause the looops will test each element but how do i make it that if 1 is true the entire conditional (if statment) is true regardless.
soo in other words............
test all the element in list and when its all tested and done then execute the commands (the open functions)
is this possible....
foreach $list (@somelist)
if($list eq 4)
{open FIL, ">>1file.txt"
}
else {
(open FIL, ">>2file.txt"
}}
--------------------------
now heres the problem the program is gonna open both files 1file and 2file cause the looops will test each element but how do i make it that if 1 is true the entire conditional (if statment) is true regardless.
soo in other words............
test all the element in list and when its all tested and done then execute the commands (the open functions)
is this possible....