Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Keep It Simple, Stupid
 
PerlMonks  

Re: Checking environment smart solution

by citromatik (Curate)
on Jun 24, 2009 at 07:33 UTC ( #774280=note: print w/ replies, xml ) Need Help??


in reply to Checking environment smart solution

If you are using Perl 5.10, the give...when construction may be of interest here (see perlsyn:

use feature qw/ :5.10 /; # or just: use feature "switch"; sub inspect { my $window,$informix,$oracle,$sql) = @_; $$window=1 if ($^O eq 'MSWin32' or $^O eq 'Windows_NT'); given ($ENV{FRUNEXT}) { when ('ifx') { $$informix=1; } when ('msv') { $$sql=1; } when ('ora') { $$oracle=1; } default { err_msg( "Database Environment Variable 'FRUNEXT' Not Se +t: $!\n") && exit } }

citromatik


Comment on Re: Checking environment smart solution
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-04-16 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (424 votes), past polls