Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] Reg variables loaded from a file using require

Expand Messages
  • igotux igotux
    Were you able to solve this ? If so, how... /Tux On Tue, Mar 24, 2009 at 10:40 AM, yaswanth krishna
    Message 1 of 6 , Mar 28, 2009
      Were you able to solve this ? If so, how...

      /Tux
      On Tue, Mar 24, 2009 at 10:40 AM, yaswanth krishna <
      yaswanth.krishna@...> wrote:

      > Hi,
      >
      > I am using a script where it works out of loop and loads different configs
      > everytime from config files. I am loading that configs using 'require'
      > everytime.
      >
      > But the problem is, variables loaded once are not getting cleared, because
      > of which if the same variable is not defined in 2nd config file, script is
      > still using the value it require'd from 1st config file. Can anyone tell me
      > how to clear the variables loaded from 1st config file before moving to 2nd
      > one..
      >
      > flow something looks like this:
      > --------------------------
      > foreach ('a.conf', 'b.conf') {
      >
      > require '$_';
      > # Here I am having some code using those vars
      >
      > }
      > --------------------------
      > #a.conf
      >
      > $var1 = 0;
      > $var2 = 1;
      > --------------------------
      >
      > #b.conf
      >
      > $var1 = 10;
      > --------------------------
      > Though $var2 is not there in b.conf, script is still using the value loaded
      > from a.conf.
      >
      > I can manually clear every var using 'undef'. But is there any other way to
      > handle this problem to clear all variables loaded from a file.
      >
      > Thanks,
      > -Yaswanth
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.