in reply to Managing Architecture-Dependant Perl Modules in an Object-Oriented Hierarchy

One way would be to keep in mind that the use lib pragma adds an architecture-dependant directory below the directory you name. So you could place the version for Win under the "whatever windows is" subdirectory, and the other version under the other directory.

Another would be to have a wrapper interface that does something like:

BEGIN { eval 'require Win32::Internet'; unless ($@) { require MyWin32Wrapper; MyWin32Wrapper::->import(); } else { require Net::FTP; # Net::FTP::->import(); # OO interface - no need to do this require MyUnixWrapper; MyUnixWrapper::->import(); } }
and then set up a common interface defined two different ways, depending on the success of requiring the Win32 version. So both of your wrapper files would define and export, say, fetch_file, but in different ways.

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Managing Architecture-Dependant Perl Modules in an Object-Oriented Hierarchy
  • Download Code