This is happening on a number of programs I wrote. 
Oddly enough the one I mentioned in my last post works
fine now. 

Here is code copied directly from the book:

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

It is sitll happening with this program. Here is the
output I'm, getting:


C:\Perl\bin>perl array3.pl
Enter the line number: 4
Enter the lines , end with ^Z:
one
two
three
four
five

C:\Perl\bin>

After "five" I hit a return and then ^Z, but the
program did not print the answer line...

Ed


--- Dan Brown <[EMAIL PROTECTED]> wrote:
> Is that all of your code?  I tried it with Perl
> 
>      C:\WINNT\PROFILES\dan>perl -V
>      Summary of my perl5 (5.0 patchlevel 5
> subversion 03) configuration:
>        Platform:
>          osname=MSWin32, osvers=4.0,
> archname=MSWin32-x86-object
>          <more stuff>
> 
> on NT (I don't have an ME machine around to try this
> on) and the
> following works fine:
> 
>      C:\WINNT\PROFILES\dan>type test.pl
>      use strict;
> 
>      my @list = <STDIN>;
>      print "I will now print your list in
> reverse.\n";
>      print reverse(@list);
> 
>      C:\WINNT\PROFILES\dan>test.pl
>      one
>      two
>      three
>      <crtl-c>
>      I will now print your list in reverse.
>      three
>      two
>      one
> 
>      C:\WINNT\PROFILES\dan>^C
> 
> Note that when running the script the text
> "<ctrl-c>" isn't printed
> until the script exists.  It's printed the input
> prompt that appears
> after the script exist.  I added it to make it clear
> what was entered
> where.
> 
> If the code you include below is not all of your
> code, perhaps there's
> something happening that we on the list cannot see?
> 
> Dan
> 
> 
> Ed Keer wrote:
> > 
> > Here's a very beginner question.  I am working
> through
> > the learning perl for win32 book and find that
> when I
> > use <STDIN> to out info into an array, the program
> > ignores the following print line.  For example,
> given
> > the folliwng lines in the program:
> > 
> > >@list = <STDIN>;
> > >print "I will now print your list in reverse.\n";
> > >print reverse(@list);
> > 
> > the output skips over the first print line.
> > 
> > I have a HP PC with Windows ME.  Any ideas on what
> > could be goin on here?
> > 
> > Ed
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great
> prices
> > http://auctions.yahoo.com/


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to