http://www.perlmonks.org?node_id=41997


in reply to Re: Continued Fractions
in thread Continued Fractions

Why would <STDIN> differ from <> in this respect? Hitting an EOF character should work the same in either case. The only difference between <STDIN> and <> is that the latter will step through the lines of any files specified on the command line:
$ perl script.pl $ perl script.pl file1 file2 filen
The first reads from the STDIN, but the second only references the contents of each of the files.

Replies are listed 'Best First'.
Re: Re: Re: Continued Fractions
by fundflow (Chaplain) on Nov 16, 2000 at 21:25 UTC
    Yup, little difference indeed.

    The emphasis was on the || exit thing. Without it the script will have to be killed explicitly, and perl script.pl < my_prepared_input > theoutput will loop forever.

    Anyway, it was just a small suggestion (and a good practice in general)