I use Active Perl in windows to do my perl scripting and then migrate it to a Linux machine. I've found two bugs:
1) I parse a file and I read segments to get values. One segment looked like:
Code:
$stringValue = substr($n,64,20);
And with Active perl this worked great! So my testing worked great. I move this to production and everything worked great. Then one file I get some odd values. The substr was actually assigning more than 20 characters all of a sudden. I received around 40. I could change the 64 starting value to 60, 70, etc and it would always grab more than 20. I had to end up doing this to make it work in Linux:
Code:
$stringValue = substr($n, 64, 20);
$stringValue = substr($stringValue, 0, 20);
Very odd....
2) Again I'm reading segments and everything is fine in windows. I move it to Linux and have issues. I am using a substr:
Code:
$value = substr($n, 0, 256);
But I get wierd results in Linux so I had to modify to this:
Code:
$value = substr($n,0,128);
$value = $value . substr($n, 0, 128);
Can anyone explain this to me or tell me a fix? I'd like my test and production environment to work the same.