http://www.perlmonks.org?node_id=774280


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