Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've run into a bit of a problem. When I'm trying to use <STDIN> in scalar context my scripts are executed without me being able to give an input. But in list context <STDIN> works just fine. This problem occured very suddently. Programs that worked an houre ago aren't working now. What's going on? Do I have a bug in my computer?
Exampel:
This dosen't work:
This does:#!/usr/bin/perl $a = <STDIN>; print $a;
Greatfull for any suggestions.#!/usr/bin/perl @a = <STDIN>; print @a;
update (broquaint): added formatting and changed title (was STDIN)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: STDIN behaves different according to context
by broquaint (Abbot) on Feb 17, 2003 at 12:38 UTC | |
by hardburn (Abbot) on Feb 17, 2003 at 15:00 UTC | |
by LAI (Hermit) on Feb 17, 2003 at 13:52 UTC | |
by Anonymous Monk on Feb 18, 2003 at 07:52 UTC | |
|
Re: STDIN behaves different according to context
by davorg (Chancellor) on Feb 17, 2003 at 12:19 UTC | |
|
Re: STDIN behaves different according to context
by Coruscate (Sexton) on Feb 17, 2003 at 16:27 UTC |