Beginner needs help with script :)

From: Player (notachance_at_inhell.com)
Date: 05/31/04


Date: Mon, 31 May 2004 11:33:43 +0100

Hello all

 I am teaching myself perl, with the help of a few texts/tutorials and a
book.
I have installed the latest Activestate perl build ActivePerl 5.8 on my
WindowsXP Pro machine.
Everything seemed to be going alright with the first few scripts, up untill
I did this one.

%grades=();

print "Enter students names (press <CTRL>+D when done): ";
@names = <STDIN>;
chomp @names;
print "\n\n";
print "Enter associated grades (press <CTRL>+D when done): ";
@scores = <STDIN>;

@grades{@names} = @scores

The problem is when I am inside the command prompt window and run the
script, i called it gradehash.pl, it runs fine to the first stdin line were
after I have finished entering the names to go into the @names list, I have
to press <CTRL>+D in order to stop that stdin and the script to go onto the
next line.
By pressing <CTRL>+D alls I get is this ^D coming up insteadof it
stopping the stdin and going to run the next line of the script.

Can anyone help me?
Can I only use <CTRL>+D on a linux setup? and if so what is the windows
alternative for what I am trying to do in those lines?

Thanks in advance :)
Player



Relevant Pages