http://qs321.pair.com?node_id=1051833

mkk82 has asked for the wisdom of the Perl Monks concerning the following question:

Hi there!

I really Need help!

In a nutshell: The output here:

print "start" . $type . "end"; is unequals the output here:
open (FH, 'out.txt'); print FH "start" . $type . "end"; close FH;

Some more details:

I receive an email via Mail::IMAPClient and store the message in one single scalar variable. Thereafter, use some RegEx to find several pieces of text.

The RegEx look like this:

my $type = ""; if ($msgString =~ m/Typ\s*:\s*(\w+)/i) { $type = $1; $type =~ s/\r\n//g; }#if print "start" . $type . "end";

This should give me:

start orange end

This works on a couple of text pieces I am after but on some the console output is screwed up and looks like this:

start range

As you can see, the first letter is missing and the final "end" string is not printed at all.
I even tried something like this and could believe my eyes:

print "start" . $type . "end\n"; print "$type\n"; print "xxxxxxxxxxxxxxxxxxxxxxx$type\n";

Console output:
xxxxxxxxxxxxxxxxxxxxxx
endrange

And keep in mind: When I write to a file, I get exactly what everbody would expect.
Any ideas?
PS: Perl 5.8.8 for MSWin32