Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Print contents of text file line by line

by jbodoni (Monk)
on Jun 24, 2018 at 14:27 UTC ( #1217320=note: print w/replies, xml ) Need Help??


in reply to Print contents of text file line by line

Here's one way to do it</p.

#!/usr/bin/perl use strict;use warnings; print while ( <> );

You'd run it by invoking the program name followed by the name of the text file: program.pl textfile.txt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217320]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2023-03-20 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (59 votes). Check out past polls.

    Notices?