On Tue, Dec 06, 2005 at 11:58:16AM -0600, JupiterHost.Net wrote:
> Shawn Corey wrote:
>
> >JupiterHost.Net wrote:
> >
> > {
> >
> >> my $foo = load_100M_of_data();
> >>
> >> print $foo; # $foo is using 100M of memeory ±
> >>
> >
> > } # memory for $foo has been released
>
> Good idea Shawn :) the actual project is one thing, I'm really mostly
> curious if that is true or not, that its out of scope when its last
> referenced in a block instead of the end of a block.
In a language like Perl, it can be pretty hard to determine when a
variable is last referenced. Here's a simple example. When is $h last
referenced?
perl -le 'my $h = 17; print $h; my $i = chr <>; eval "print \$$i"'
Do you have your answer?
Now run it and type in 103. Then run it again and type in 104.
Were you right?
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>