I need to modify the following string
$filename = "/wek/hep/bin/defaults.import"
to
$filename = "/wek/hep/bin/defaultsxxxx.import"
where xxxx is the value of an environment variable called APPL_ENV
Edit: Changed title to something more meaningful - davorg