in reply to cross platform scripts

Perhaps read in the config info in a BEGIN block.

BEGIN { if ($^O eq "MSWin32") { require Win32::TieRegistry; # require not use # read some stuff from registry } else { open (CONFIG, '/etc/something') or die "$!:Blech\n"; # read some config info in } }

Replies are listed 'Best First'.
Re: Re: cross platform scripts
by Anonymous Monk on Jan 21, 2003 at 22:45 UTC
    This will call "import Tie::Registry" in adition to the require, as expected. Also, this method is backward compatible with perl 5.005.

    eval "use Win32::TieRegistry";