"Fiaz Idris" <> wrote in message
news: om...
> I am using Win98SE and cygwin
> while (<>) {
> chomp;
cygwin uses NL as end of file marker, and chomp will remove that
however, you input file is probably a windows text file, where
lines are terminated with CR+NL, so you now have your line
with an extra CR at the end. try:
s/\r//g;
> $curr = $_;
>
> $scurr = join '', (sort split //, $curr);
> $scurr =~ s/\W//g;
>
> # Behaviour inconsistent between ActivePerl5.8 & Cygwin Perl
> # $curr although printed can't be seen.
>
> print "$curr and $scurr\n";
the CR in print on terminal has the effect to move the cursor to beginning
of line,
so the " $scurr" overwrites the $curr
> }
gnari
|