Perl-nested-loops
提供:Dev Guides
Perlネストループ
ループは、別のループ内にネストできます。 Perlでは、すべてのタイプのループをネストすることができます。
構文
Perlでの nested for loop ステートメントの構文は次のとおりです-
Perlの nested while loop ステートメントの構文は次のとおりです-
Perlの nested do … while loop ステートメントの構文は次のとおりです-
Perlでの nested until loop ステートメントの構文は次のとおりです-
Perlの*ネストされたforeachループ*ステートメントの構文は次のとおりです-
例
次のプログラムは、ネストされた while ループを使用して使用方法を示します-
これは、次の結果を生成します-