Re: Lazy evaluation?
- From: xhoster@xxxxxxxxx
- Date: 14 Feb 2007 17:05:11 GMT
Rob Hoelz <hoelz@xxxxxxxx> wrote:
In a statement like this:
local $\ = "\n";
foreach $num (1..1000_000_000) {
print $num;
}
or this:
local $\ = "\n";
foreach $line (<$handle>) {
chomp $line;
print $line;
}
does Perl use lazy evaluation? Thanks!
First one yes, second one no. (For the second, use while instead)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- References:
- Lazy evaluation?
- From: Rob Hoelz
- Lazy evaluation?
- Prev by Date: Re: Lazy evaluation?
- Next by Date: Re: waitpid woes on Solaris, Perl 5.8.8
- Previous by thread: Re: Lazy evaluation?
- Next by thread: Bind 9 administration module(s)
- Index(es):
Relevant Pages
|