- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The Infinite Loop in Perl
A loop becomes an infinite loop if a condition never becomes false. The for loop is traditionally used for this purpose. Since none of the three expressions that form the loop are required, in Perl, you can make an endless loop by leaving the conditional expression empty.
#!/usr/local/bin/perl for( ; ; ) { printf "This loop will run forever.\n"; }
You can terminate the above infinite loop by pressing the Ctrl + C keys.
When the conditional expression is absent, it is assumed to be true. You may have an initialization and increment expression, but as a programmer more commonly use the for (;;) construct to signify an infinite loop.
- Related Articles
- Infinite while loop in Java
- Java infinite for loop
- Incremental Java infinite loop
- Java infinite do-while loop
- Loop Control Statements in Perl
- How to create an infinite loop in C#?
- How to run an infinite loop in Tkinter?
- How to stop an infinite loop safely in Python?
- How we can come out of an infinite loop in Python?
- How to break out of a loop in Perl?
- What keyboard command we have to stop an infinite loop in Python?
- Creating a Slider / Carousel with CSS Flexbox (with infinite repeating items in loop)
- How do you create a Tkinter GUI stop button to break an infinite loop?
- The ? : Operator in Perl
- The $[ Special Variable in Perl

Advertisements