I have this app that is cross platform, supports window, linux, solaris, aix,hpux, linux-z, .. 32 and 64 bit.
as I port around, I keep running into some windows only modules not available on other platforms.. duh..
so, I'd like to convert my 'use Win32' to 'require Win32'.
and load the library.. seems simple.. but I guess I must be missing the last little thing..
current code
$my osname = Win32::GetOSName();
(note the lack of an explicit 'use')
using examples on the web I changed it to
my modname='Win32';
require $mymodname;
import $mymodname qw(GetOSName);
$my osname = GetOSName();
which fails
Undefined subroutine &main::GetOSName
all the examples seem to be fine, but they don't show the code that consumes the functions of the package when used in a dynamic load implementation.
thanks
Sam
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.