Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Conditional use of Win32::TieRegistry

by 1nickt (Canon)
on Nov 13, 2017 at 18:58 UTC ( [id://1203280]=note: print w/replies, xml ) Need Help??


in reply to Conditional use of Win32::TieRegistry

Hi, see if:

use if $^O =~ 'MSWin32', 'Win32::TieRegistry';
(not sure about the regex, not a Windows user).

Hope this helps!

Update: added quoting to module name, see below


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Conditional use of Win32::TieRegistry
by hilitai (Monk) on Nov 13, 2017 at 19:15 UTC

    Works for Windows, fails on Linux:

    Too few arguments to `use if' (some code returning an empty list in list context?) at /usr/lib/perl5/5.10.0/if.pm line 7.

      Sorry, missed quoting the module (necessary if no args provided, like use if CONDITION, MODULE => ARGUMENTS;)

      Should be:

      use if $^O =~ 'MSWin32', 'Win32::TieRegistry';
      ... but I'm sure you saw that in the doc I linked to, right?


      The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1203280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found