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:
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);
Very odd....Code:$stringValue = substr($n, 64, 20); $stringValue = substr($stringValue, 0, 20);
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:
But I get wierd results in Linux so I had to modify to this:Code:$value = substr($n, 0, 256);
Can anyone explain this to me or tell me a fix? I'd like my test and production environment to work the same.Code:$value = substr($n,0,128); $value = $value . substr($n, 0, 128);
must be an issue with the data you are running through the substr() function. There is no differenc between substr on winodws or linux that I am aware of.
I'll take a look.
I will as well. I have various Linux machines I can test on and will install ActivePerl if you tell me the version you use.
Ok, I'll post all the information to replicate this problem next week when I'm back at work.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks