Re: use Win32::TieRegistry if ($^O =~ /win32/i)
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 1 Jun 2006 10:25:17 -0700
shelden0@xxxxxxxxxxx wrote:
I thought this would be really easy...how do I conditionally use a
package? I.e., only use the Registry Package if I'm on Windows?
Assuming you have a recent version of perl (I think 5.8.0 or higher,
maybe?), see:
perldoc if
If you don't have that recent a version of perl, either download this
module from CPAN (http://search.cpan.org/~ilyaz/if-0.0401/if.pm) or use
an eval on the two separate components of a 'use' statement. (See
perldoc -f use)
I tried wrapping in evals, etc., but they don't seem to work.
"does not work" is the worst of all possible error descriptions. *how*
does it not work? Syntax error? Runtime error? Incorrect output?
Computer blows up?
In fact, in this case, it must also be asked *what* does not work?
Where is the code that demonstrates what you tried? How can we help
you fix your code if you don't show us your code?
Perhaps because compliation errors cannot be trapped?
Ahh, there's the old standby. "I can't figure out how to do this,
therefore it must not be possible." Do you even realize how supremely
arrogant that question is?
Please read the posting guidelines for this group. They will help you
to ask better questions and therefore to get better answers.
Paul Lalli
.
- Follow-Ups:
- Re: use Win32::TieRegistry if ($^O =~ /win32/i)
- From: shelden0@xxxxxxxxxxx
- Re: use Win32::TieRegistry if ($^O =~ /win32/i)
- References:
- use Win32::TieRegistry if ($^O =~ /win32/i)
- From: shelden0@xxxxxxxxxxx
- use Win32::TieRegistry if ($^O =~ /win32/i)
- Prev by Date: Re: use Win32::TieRegistry if ($^O =~ /win32/i)
- Next by Date: Re: reading from pipe, writing to a file
- Previous by thread: Re: use Win32::TieRegistry if ($^O =~ /win32/i)
- Next by thread: Re: use Win32::TieRegistry if ($^O =~ /win32/i)
- Index(es):
Relevant Pages
|
|