Re: Different way of getting Standard input
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Mon, 31 Dec 2007 04:09:05 -0800
Prabu Ayyappan wrote:
Hi All,
Hello,
What is the difference in Accepting the following form of standard input?
1) $a = <STDIN>;
readline() from the standard input device in scalar context.
2) $b = <stdin>;
Same as 1 but using the deprecated lower case form of STDIN.
3) $c = <>;
readline() from the files in @ARGV or if @ARGV is empty then readline() from STDIN.
Now check,
print $a $b $c;
What is actually happening?
Will this be written to some standard input file?
There is no "standard input file".
If so In windows where this will be written?
print() without an explicit filehandle will print to the currently selected filehandle, which by default is STDOUT.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
.
- References:
- Different way of getting Standard input
- From: Prabu Ayyappan
- Different way of getting Standard input
- Prev by Date: Re: Handling errors when working with files
- Next by Date: Re: Different way of getting Standard input
- Previous by thread: Different way of getting Standard input
- Next by thread: Re: Different way of getting Standard input
- Index(es):