If statements inside or outside loops?
- by Timmy
Is it better if I do this:
foreach my $item ( @array ) {
if ( $bool ) {
.. code ..
}
else {
.. code ..
}
}
or
if ( $bool ) {
foreach my $item ( @array ) {
}
}
else {
foreach my $item ( @array ) {
}
}