gjoshi has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I am using in my perl script use Win32::OLE::Variant and calling function Variant(VT_UI1, $data); I am moving my code to Linux so need the linux replacement of it. anyone what to use?

thanks --girija
  • Comment on use Win32::OLE::Variant -- Linux replacement

Replies are listed 'Best First'.
Re: use Win32::OLE::Variant -- Linux replacement
by Corion (Patriarch) on Aug 07, 2015 at 06:18 UTC

    Linux has no concept of COM and OLE. Running your script on a platform other than Windows will need a rewrite of all functionality that uses OLE.

Re: use Win32::OLE::Variant -- Linux replacement
by Anonymous Monk on Aug 07, 2015 at 09:13 UTC

    VT_UI1 appears to be a 1-byte unsigned integer, so I'm guessing you're doing some kind of data type conversion? In Perl, many data conversions you may be used to from other languages are not needed, or can be replaced by built-ins. Perhaps if you told us what your use of the Variant function is accomplishing in Windows, with sample input and output data, we could suggest a replacement.

Re: use Win32::OLE::Variant -- Linux replacement
by Anonymous Monk on Aug 07, 2015 at 07:18 UTC

      I don't want to install Win32::OLE on Linux. I will rewrite the code. But anyone know what is equivalent functionality Variant() function is doing in Linux?

      thanks --girija

        As I already said, Linux has no concept of COM and OLE. Variant() is a variable type of OLE, and as such does not exist on Linux.

        Maybe you can tell us what problem you are trying to solve? Usually this involves automating some program, like Microsoft Word or Microsoft Excel. These programs also don't run on Linux.

        I don't want to install Win32::OLE on Linux. I will rewrite the code. But anyone know what is equivalent functionality Variant() function is doing in Linux?

        OLE/COM is windows technology is a windows concept/product, its not a unix thing.

        If you want OLE/COM on linux you have to use Wine which aims to allow applications designed for Microsoft Windows to run on Unix-like operating systems.

        Now if you could be more specific as to what you're doing with Win32::OLE there might be other linux software capable of doing the same job

Re: use Win32::OLE::Variant -- Linux replacement
by Anonymous Monk on Aug 07, 2015 at 18:00 UTC
    Research QVariant