in reply to Bundling a module with a distribution (cross-platform)

Clone seems to be an XS module, which short of compiling it on the system you are installing this on, is going to make portability a real pain. While slower, you might look at Storable's dclone (as the Clone docs mention), since Storable is part of the core distribution.
  • Comment on Re: Bundling a module with a distribution

Replies are listed 'Best First'.
Re^2: Bundling a module with a distribution
by qq (Hermit) on Dec 30, 2004 at 00:56 UTC

      Devel::UseAnyFunc, which Clone::Any depends on, uses eval { require $pm } to check for available modules. It does not check whether the call of the clone function succeeds.

      In this case with an unsupported architecture, the whole thing fails when clone is first called. That's why, unfortunately, Clone::Any does not work here. simonm pointed me to this in an email.

      Probably Devel::UseAnyFunc can be expanded by a eval call of the function in question (here clone). I'll mention this to simonm. On the other hand, Devel::UseAnyFunc would need to know how the function wants to be called. Oh well...

      Clone::PP looks like the solution (thanks qq). Albeit slower than Clone (and Storable for that matter) and having some limitations, it probably will work well for my purposes.

      Storable's dclone would also work. It is part of the core distribution of perl. Maybe I should use that. On the other hand, this may change with Perl 5.10.

      What, me indecisive? ;-)

        Devel::UseAnyFunc, which Clone::Any depends on, uses eval { require $pm } to check for available modules. It does not check whether the call of the clone function succeeds.

        Yup; I basically assumed that if the module is installed, it will work.

        The code for Devel::UseAnyFunc is fairly simple, so you could build your own version of it that also did this extra check before deciding which function to import.

Re^2: Bundling a module with a distribution
by freddo411 (Chaplain) on Dec 30, 2004 at 00:22 UTC
    ++ to parent.

    You are on to the right track, but the module in question is a compiled binary, which means you are not going to be able to distribute an identical version of your app for a different platform. You'll have to have an "installer" script unpack and compile the module (perhaps in your local dir location).

    I can report that I package up several CPAN modules into a local ./Modules directory so that I can easily move the entire local dir tree up for packaging and installation onto different machines. However, I am fortunate to be installing on to identical hardware.

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday