#!/usr/bin/perl use strict; use warnings; if ($^O eq 'MSWin32') { eval { require Win32::OLE; Win32::OLE->import; }; *bar = sub { print "Win32\n" }; } else { *bar = sub { print "Not Win32\n" }; } #later in the program... #we don't care what OS is running -- implementation details are hidden bar();
In reply to (RhetTbull) Re: Re: Runtime module use and sub definitions
by RhetTbull
in thread Runtime module use and sub definitions
by RhetTbull
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |