Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: ??? how to print only one line

by IraTarball (Monk)
on Aug 23, 2001 at 20:56 UTC ( [id://107399]=note: print w/replies, xml ) Need Help??


in reply to ??? how to print only one line
in thread a few basic questions

This sounds like a job for the evil 'goto'...
use strict; use warnings; open (T1, "t1") or die; my $line; my $flag = 1; my $counter; DATA: while (<DATA>) { print; goto T1; } T1: while (<T1>) { print; goto DATA; } __END__ file1 file1 file1 file1
This prints...
file1 file2 file1 file2 file1 file2 file1 file2 file2 file3, kidding... file2

Ira,

"So... What do all these little arrows mean?"
~unknown

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2024-04-24 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found