0 Replies - 1190 Views - Last Post: 30 August 2014 - 07:16 PM

#1 technocrattobe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 30-August 14

information exchange without parameters/globals

Posted 30 August 2014 - 07:16 PM

The problem is simple.

There is a line that calls a series of modules before running a command one at a time

obj.update("newtests") 


At the end of the chain all it is doing is call: ls -l test_name.
This happens for each test and there are n ls commands run.

I want change this behavior slightly. Instead of running ls n times , i want to collect the test names in a file as tsv
and run ls against all these at once.

obj.update("newtests") #doesn't execute commands, just writes test_name to a file
run_command(file_name) #my code to execute contents of file_name


I tried to make a global var but update calls modules that doesn't behave well with global variables.
My question is : How to choose this file name in perl so that the update and run_command functions know about them without passing it as an argument?
The code gets executed in multiple folders concurrently , so the file name should work in distributed environment as well.

Any help is greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1