1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# Env.rb -- imports environment variables as global variables, Perlish ;( # Usage: # # require 'Env' # p $USER # $USER = "matz" # p ENV["USER"] require 'importenv' if __FILE__ == $0 p $TERM $TERM = nil p $TERM p ENV["TERM"] $TERM = "foo" p ENV["TERM"] end