Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Same is different?

by BooK (Curate)
on May 29, 2001 at 00:58 UTC ( #83788=perlmeditation: print w/replies, xml ) Need Help??

In CGI will be with you, always, I used the content of to extract all four letter bits from it. I took care of line endings using chomp. Still, on different platforms, with the same version of, I get different results.

Why is it that the same version of is different on different platforms? For further checking:

$CGI::VERSIONPerl -varchOS Platform/versionMD5 hash
2.465.005_03MSWin32-x86-object (ActiveState 522)MS-Windows/4.10.1998,P903d4ad8e2d17990437c999eef9490c3
2.565.6.0i386-linuxLinux Mandrake/2.2.14-15mdk94ecf90cf567e9435a3db89ef50a72b7
2.745.6.0 MSWin32-x86-multi-thread (ActiveState 620)MS-Windows/4.10.1998,P355fc673032bedeb3cc0cb042738af22

Naturally, this calculus has problems, since line endings do vary between Win32 and Unix... But still, there are differences. Why?

Update: So I am stupid. tye suggested to use diff, which showed me the differences: some hardcoded globals, like $TempFile::TMPDIRECTORY do change between OSes...

Tool used: perl -p0777MDigest::MD5=md5_hex -e '$_=md5_hex$_'

Replies are listed 'Best First'.
Re: Same is different?
by DrZaius (Monk) on May 29, 2001 at 19:26 UTC
    Does this mean that CGI isn't always with you if you are trying to build a portable system?

    This is complete theory, but merlyn suggested in a previous node that in the worst case you can include the contents of CGI in a BEGIN block.

    If there are platform specific variables, this means you have to change your code for different platforms.

    Same deal with use lib.

      I think this mostly means I am a stupid wheening moron... :-S

      In my obfuscated code, I assumed that the same version of would be identical (except for line-endings) on every platform Perl runs on. This is false. But the differences are in fact very tiny (a few lines), and mostly regard configuration parameters, which actually and naturally change between platforms and installs.

      I think the Perl core (and CGI is part of the standard distribution) is you best bet at portable code. This doesn't include Obfuscation, that's all... :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://83788]
Approved by root
[Eily]: if you want to store in a structure with the coordinates as key, arrays might do, since the keys are going to be 0..n
[LanX]: (Pascale path)
[Eily]: paths like that
[Discipulus]: yes Eily++ (very keen) I want to integrate my project with a 17th experiments. I want to colorize in sequence all paths
[oiskuu]: Yeah, modifry the recursive func combinations() to return not the number, but the paths themselves.
[Eily]: Discipulus I'd do that by starting from the bottom node I think. That way it can inherit the paths from the two nodes above (and so on, recursively)
[LanX]: oh I meant fixed amount
[LanX]: every path must have l left and r right edges and l and r are fixed and l+r is the height
[LanX]: simple recursive function which goes left and right till l or r are exhausted
LanX #solved

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-03-19 11:22 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.