Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w # use strict ; use FileHandle ; # # SCALAR VARIABLES #-----------------# my $key = undef ; my $opfile = 'xxrc_env_details' ; my $result = 0 ; my $script = 'xxrcenvtest' ; my $value = undef ; my $footer = "\n\t\t***** End of Report *****\n\n" ; # # F O R M A T T I N G #-------------------# format XXRC_TOP = ENVIRONMENT Details for IHSLIVE . # format XXRC = @<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<< $key, $value . # # P R O C E S S I N G #---------------------# # print "\n\t\t*** $script S T A R T S ***\n" ; # $result = system(". /opt/bin/oraIHSLIVE.env") ; # print "\n\tRES :: $result\n" ; if ($result) { print "\n\t\tRes :: $result\n" ; print "\n\t\tBombing Out (1)\n" ; exit 122 ; } # $result = system(". /opt/bin/fsw.env IHSLIVE") ; # if ($result) { print "\n\t\tRes :: $result\n" ; print "\n\t\tBombing Out (2)\n" ; exit 123 ; } # open XXRC, ">$opfile" or die "\n\tCanny Open $opfile :: $!\n" ; # # Formating code #--------------# select XXRC ; STDOUT->format_top_name("XXRC_TOP") ; STDOUT->format_name("XXRC") ; foreach $key (sort keys %ENV) { $value = $ENV{$key} ; write or die "\n\tyou hivnae goat this richt min! :: $!\n" ; } #STDOUT->format_name("XXRC_2") ; #write or die "\n\tyou hivnae goat this richt min! :: $!\n" ; select STDOUT ; print XXRC "$footer" or die "\n\tyou hivnae goat this richt min! :: $! +\n" ; close XXRC or die "Canny Close $opfile :: $!\n" ; print "\n\t\t*** $script E N D S ***\n\n\n" ;
2006-04-29 Retitled by planetscape, as per Monastery guidelines
Original title: 'Envoronment variables?'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: set environment for parent process
by Corion (Patriarch) on Apr 28, 2006 at 12:36 UTC | |
by Ronnie (Scribe) on Apr 28, 2006 at 13:34 UTC | |
by Corion (Patriarch) on Apr 28, 2006 at 16:08 UTC | |
by Anonymous Monk on Apr 28, 2006 at 16:10 UTC | |
by chargrill (Parson) on Apr 28, 2006 at 19:08 UTC | |
|
Re: set environment for parent process
by sgifford (Prior) on Apr 28, 2006 at 18:02 UTC |