Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Checking environment smart solution

by citromatik (Curate)
on Jun 24, 2009 at 07:33 UTC ( [id://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

Log In?
Username:
Password:

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

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

    No recent polls found