my @arr = ( 1, 2, 3 ); while( @arr ){ print $_, "\n"; }
出力結果
1 2 3
または
my @arr = ( 1, 2, 3 ); while my $arr ( @arr ){ print $arr, "\n"; }
$arrNum = array( 1, 2, 3 ); while( $arrNum as $num ){ echo $num. "\n"; }