Hello. This is my first post to the List. I am just getting my feet wet with perl, my first programming language.

I'm running perl 5.8.4 on Libranet linux, a now-defunct distro based on out-of-date Debian (Sarge or before, I think).

I am having trouble inputting a value via <STDIN>.

Here is my troublesome script:

#!usr/bin/perl

use strict;

open F, "JunkTestText.txt";
local $/ = "\*\*\*";
my @sections = <F>;
close F;

print @sections;
print "\n\n ------------end of echo check--------- \n\n";

my $patient="";

print "Which patient are you looking for?\n";
chomp($patient = <STDIN>);
print "you are looking for $patient\n";

When executed, it runs up to and including asking me for input from the terminal. When I enter a value for $patient (a 7-digit number) and press enter, nothing happens. The cursor goes down to the next line and just waits.

If I replace the whole STDIN thing with a fixed value for $patient, the script runs fine.

Appreciate any advice.

--Chris

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to