in reply to Re: <> oddity ?
in thread <> oddity ?
As expected... hmm.
Define a sample.txt like
where test.pl is
And then run $ test.pl sample.txt1 2 3
where test.pl is
Why would this program then NOT wait for any further input via STDIN ?#!/usr/bin/perl use strict; use warnings; my $i = 0; while (<>) { print $_; last if ++$i >= 2; } my $line; print "My extra line: $line" while $line = <>;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: <> oddity ?
by LanX (Saint) on Mar 27, 2013 at 11:50 UTC | |
by Krambambuli (Curate) on Mar 27, 2013 at 12:18 UTC | |
by Krambambuli (Curate) on Mar 27, 2013 at 11:58 UTC |
In Section
Seekers of Perl Wisdom