Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: ??? how to print only one line

by IraTarball (Monk)
on Aug 23, 2001 at 20:56 UTC ( #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
Node Status?
node history
Node Type: note [id://107399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2019-05-23 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (146 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!