in reply to Managing Architecture-Dependant Perl Modules in an Object-Oriented Hierarchy
Another would be to have a wrapper interface that does something like:
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.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(); } }
-- Randal L. Schwartz, Perl hacker
|
|---|