Use while loop to read console input : While « Statement « Perl

Home
Perl
1.Array
2.CGI
3.Class
4.Data Type
5.Database
6.File
7.GUI
8.Hash
9.Language Basics
10.Network
11.Regular Expression
12.Report
13.Statement
14.String
15.Subroutine
16.System Functions
17.Win32
18.XML
Perl » Statement » While 
Use while loop to read console input
    

while ($_ = <>) {
    print $_;
}
while (<>) {
    print;
}

   
    
    
    
  
Related examples in the same category
1.A program that demonstrates the while statement.
2.A program that loops using a single-line conditional statement.
3.A while loop is often used to read from a file until there is no more data available.
4.Analysis of sales results
5.Average-sales problem with counter-controlled repetition
6.Conditional operator: The unless Modifier and while loop and __DATA__
7.Count 10 with while loop
8.Loop with label
9.Looping Modifiers: The while Modifier
10.Looping While
11.The while Loop
12.The while command
13.The while, until, and do Statements
14.Use while loop to read console input and replace
15.Using while and for statement to check if you had typed in four letter words
16.Using while loop to calculate the number of lines in a file
17.Using while loop with each
18.Using while statement to check the entered value from keyboard
19.Using while statement to read from keyboard
20.While loop and counter
21.While loop counter
22.While statement and scalar control value
23.while and until loop
24.while data section
25.while statement to read input
26.while/until Loop
27.Using While loop the output the elements in an array
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.