Unloading packages 
Author Message
 Unloading packages

Hi,

   Is it possible to unload a package from memory and reclaim all
memory associated with this package. Reason i want to do this is
based on context in which package is required package function will
behave differently. Since i am reloading mypack again and again memory
of perl program keeps on increasing. I want to prevent this.

For example i want to do this

  #Start of main program

     delete $INC{"mypack path"};
     require "./mypack.pm";
     $mypack::abc();
     ...
     reclaim_package_space("mypack");
  }
  #End of mail program

=>mypack.pm
package mypack;
 if($main::myvar =~ /.../){
   my $a, $b;
   sub abc {
      #impl 1
   }
  else{
   my $c, $d;
   sub abc {
      #impl 2
   }
  }
1;

Best Regards,
sreekanth



Mon, 12 Apr 2004 21:13:22 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. TurboPower Object Professional

2. overload method package and unload overloads

3. Problems with Win32::TieRegistry -- $key->UnLoad

4. unloading dead modules

5. DLL unload question for embedded Perl on Windows

6. How to unload a module from memory?

7. possible to unload a module?

8. How to unload module from memory?

9. unload/reload pm's?

10. Unloading subs?

11. Reload/unload modules?

12. Unloading Perl code

 

 
Powered by phpBB® Forum Software