strange case of missing print statement in Windows perl 
Author Message
 strange case of missing print statement in Windows perl

Quote:

> X-No-archive: yes

> Can anyone explain why the print statement is MIA?

Yep.  It is a bug in the Windoze command interpreter.  It happens also
with other programs besides Perl, so it is not a Perl problem.  To see
the unseen, make the print:

     print "\nunseen \n";

It also masquerades as the infamous "my program doesn't complete
execution" program following a ^Z on STDIN.  It does -- one just doesn't
see the print statement which follows unless it starts with a \n .

Quote:

> perl v5.6.1 for MSWin32-x86-multi-thread
> binary build 631 provided by ActiveState Tool Corp.
> ---------------------------------------------

> use strict;


> $| = 1; # or 0

> print "seen \n";

> while (<STDIN>)  # or <>
> {
>    chomp ($a[$i++] = $_);
> }

> print "unseen \n"; # like it says ....

> for $i (0..$#a)
> {
>    print "\$a[$i] is $a[$i]\n";
> }

> print "seen \n";
> ---------------------------------------------
> STDOUT is:
> seen

> then, if STDIO is:
> zero
> one
> two
> ^Z

> STDOUT is:
> $a[0] is zero
> $a[1] is one
> $a[2] is two
> seen

HTH.

--
Bob Walton



Wed, 23 Nov 2005 04:00:27 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. The strange case of dbmopen() and the missing database

2. Case select statements: are they in Perl?

3. Why no case statement in Perl?

4. How to do case statements in perl

5. Is there CASE statement in Perl?

6. IS there a Case Statement in Perl?

7. Case statement in perl

8. Case Statement in Perl.

9. Case of the missing cc and re

10. CASE statement any??

11. makeshift case statements

12. Need a Case Statement!

 

 
Powered by phpBB® Forum Software