in reply to Using a 'package' as a 'module', and choosing at runtime?
Sure you don't need to actually require/use anything, but @ISA is @ISA ;)(perldoc perlmod, perldoc perlvar ...)package File::Spec; use strict; use vars qw(@ISA $VERSION); $VERSION = '0.86'; my %module = (MacOS => 'Mac', MSWin32 => 'Win32', os2 => 'OS2', VMS => 'VMS', epoc => 'Epoc', NetWare => 'Win32', # Yes, File::Spec::Win32 works on Ne +tWare. dos => 'OS2', # Yes, File::Spec::OS2 works on DJGP +P. cygwin => 'Cygwin'); my $module = $module{$^O} || 'Unix'; require "File/Spec/$module.pm"; @ISA = ("File::Spec::$module"); 1; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using a 'package' as a 'module', and choosing at runtime?
by pg (Canon) on Oct 28, 2003 at 11:20 UTC |