Monday, February 12, 2007

Perl gotcha's

I had to port a tool from Solaris 8 to Solaris 10 and I was not able to understand what was happening with the timestamps. All the events were somewhere long in th past... They were not taken into account.

I've spent 6 hours today on this silly thing:


[dvoina@su1125na08 ~]$ perl -v

This is perl, v5.8.4 built for sun4-solaris-64int

[dvoina@su1125na08 ~]$ perl
print sprintf("%x", 1000*time());
110b68ea068



while on


[dvoina@sucomp2307 dvoina]$ perl -v

This is perl, version 5.005_03 built for sun4-solaris

[dvoina@sucomp2307 dvoina]$ perl
print sprintf("%x", 1000*time());
b68c7d88



WTF: b68c7d88 on one machine and 110b68ea068 on the other?
The leading 110 were a pain in the back.
I guess that time() was changed between Perl 5.0 and 5.8.

Finally diff solved the problem.

No comments:

Post a Comment