SPUG: Control Z doesn't work either

Andy Jacobs andyj at microsoft.com
Tue Feb 29 02:14:22 CST 2000


It worked for me on NT (although I didn't enter the beginning "#perl" line
nor the *.* line).  Here's my transcript (anything not prompted for, I typed
- although the "^Z" is where I pressed Ctrl-Z):

C:\>perl
print "Enter the line number: "; chomp($a = <STDIN>);
print "Enter the lines, end with ^D:\n"; @b = <STDIN>;
print "Answer: $b[$a-1]";
^Z
Enter the line number: 2
Enter the lines, end with ^D:
111
222
333
^Z
Answer: 222

The trick is to enter the Ctrl-Z's on their own line, and press enter just
after them.  This may not be a requirement in Unix (it's been a while for
me).

 - Andy Jacobs

-----Original Message-----
From: owner-spug-list at pm.org [mailto:owner-spug-list at pm.org]On Behalf Of
Matthew Lasar
Sent: Monday, February 28, 2000 10:49 PM
To: spug-list at pm.org
Subject: SPUG: Control Z doesn't work either


Hi folks:

I've been sitting around this evening having a very frustrating time. This
program, which I've beening running on Windows 95 via the DOS prompt, comes
with instructions from "Leaning Perl" that I should enter my lines and then
hit control-D. A friend explained that that's a unix command, and that for
DOS I should use control-Z  But that isn't actually working either. I enter
some strings. I hit control Z, then return, and I get nothing, a blank
line. Even "answer" doesn't print.

What am I doing wrong? Any thoughts gratefully accepted.

thanks, Matthew Lasar

#c:\perl -w

print "Enter the line number: "; chomp($a = <STDIN>);
print "Enter the lines, end with ^D:\n"; @b = <STDIN>;
print "Answer: $b[$a-1]";

*.*

"The absent are always wrong."
	--French proverb

Matthew Lasar
171 Andover Street
San Francisco, CA 94110
matthew at lasarletter.com
www.lasarletter.com
415-641-1152
415-826-6964


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address



 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list