0

I m a beginner in perl. I want to know how to use this module. I read somewhere about this module but not getting its usage.

Actually I've a file which contains some environment paths which needs to be set while running some test(say file name is SET_ENV_TOOL1.csh or SET_ENV_TOOL1.sh) with particular tools.(say TOOL1, TOOL2 etc)

SET_ENV_TOOL1.sh file conatins:
setenv UVM_HOME /u/tools/digital/uvm/uvm-1.1a
setenv VIPP_HOME /u/tools/digital/vipcat_11.30-s012-22-05-2012
setenv VIP_AXI_PATH ${VIPP_HOME}/vips/amba_axi/vr_axi/sv/ #etc.(almost 10-15 paths are need to be set like this)

Everytime while running test, tool might get changed and so environment paths also needs to set to run that tool.

I have to make a perl script which sets these paths before running test. That test will run a command and that command will use these environment paths.

Any help would be greatly appreciated. Thanks !!

EHS
  • 251
  • 1
  • 2
  • 11
Mak_Thareja
  • 179
  • 1
  • 2
  • 11

1 Answers1

0

Reading and changing environment variables is built-in to Perl, you do not need the modules you mentioned.

$ENV{UVM_HOME} = '/u/tools/digital/uvm/uvm-1.1a';
$ENV{VIPP_HOME} = '/u/tools/digital/vipcat_11.30-s012-22-05-2012';
$ENV{VIP_AXI_PATH} = "$ENV{VIPP_HOME}/vips/amba_axi/vr_axi/sv/";
daxim
  • 39,270
  • 4
  • 65
  • 132