[tpm] chomp problem

Omid Gulban omid.gulban at sickkids.ca
Mon Feb 7 06:21:02 PST 2011


Hello All,

I have used chomp a countless number of times before and had no problem. I am also well aware of the end of line characters on various platforms. What confuses me the most as well is
when I included a "sleep 1; " in the code as listed below:

use warnings;
use strict;

while (<DATA>) {
        chomp $_;
        print "$_";
        sleep 1;

}

__END__
a
b
c
d
e
f
g
h


I expected a 1 second delay in between the print statements. BUT PERL waits 8 (1 second for a,b,c,d...h)  seconds and prints everything together!
maybe I should uninstall perl and reinstall it again!

I have used chomp for about 8 years and never seen this.




Thanks
O
________________________________________
From: toronto-pm-bounces+gulban=sickkids.ca at pm.org [toronto-pm-bounces+gulban=sickkids.ca at pm.org] On Behalf Of Omid Gulban [omgulban at yahoo.ca]
Sent: February 4, 2011 3:42 PM
To: tpm at to.pm.org
Subject: [tpm] chomp problem

Hello All,

I have a simple script shown below:
on windows xp platform.



use warnings;
use strict;

while (<DATA>) {
        chomp $_;
        print "$_";
}

__END__
a
b
c
d
e
f
g
h


Why do I get an output that looks like this:
a
ab
bc
cd
de
ef
fg
ghh

I expected to see:
abcdefg


Thanks
O


This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.


More information about the toronto-pm mailing list