You could 'delete' or 'undef' variables you don't want.  But I sense that
you want a bigger wiper than that...
If you define variables using 'my' in the sub, Perl's gargbage collection
should annihilate them when it has time/needs resources.  It might even
eliminate them as soon as you exit the sub.

eg

...lotso code ...

my $var1 = "wowzers";
my $result = testSub();

## at this point $var1 and $result should have values.  $foo and $bar won't.
## Unless you have other $foo and $bar variables declared at this ## scope
level!
## If you are looping through testSub, each iteration will overwrite (or
replace) $foo
## and $bar, so you shouldn't have 'phantom' variables taking up any space.

## if you wanna force a variable to dissappear, undef it.  Again I am not
## sure when the garbage collection reclaims the unused memory.  I am
## assuming that it will do it immediately, but I could be wrong (and often
am! ;-).

undef $var1;

sub testSub
{
    my( $foo, $bar ) = ("bah", "humbug");
    [ do stuff with $foo and $bar ]
}

## WARNING -  sluping a large file into a variable will eat up copious
amounts
## of memory!  My win2k and NT boxes unceremoniously exits Perl with an
error when a
## single Perl instance occupies > 82MB!  So code to avoid this horrible
'feature'.
<rant>you'd think that a server with 512MB of *unused* RAM would be able to
have a Perl instance of up to that free space.  But nooooo.</rant>



"Voodoo Raja" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there
>
> I have got a script running..
>
> Its ment to  repeat  a particular sub routine using the "after" syntax
>
> All i want to do is clear everything in buffer ... since it eats up the
> memory
>
>
> I do not need any varaibles which I have defined in the sub.
>
> there are more then enough to init manually.
>
> Is there any command I can use to kill any constants assigned.
>
>
> any piiece of code will be helpful
>
> thanks
> SAM
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to