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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Console output != file output
by toolic (Bishop) on Sep 01, 2013 at 17:53 UTC | |
by perlaintdead (Scribe) on Sep 02, 2013 at 15:09 UTC | |
Re: Console output != file output
by ig (Vicar) on Sep 01, 2013 at 19:39 UTC | |
Re: Console output != file output
by kschwab (Vicar) on Sep 02, 2013 at 05:11 UTC | |
Re: Console output != file output
by tinita (Parson) on Sep 02, 2013 at 10:07 UTC |