Re: Scalar variable in void context before a loop
- From: "Peter J. Holzer" <hjp-usenet2@xxxxxx>
- Date: Mon, 20 Oct 2008 22:03:45 +0200
On 2008-10-20 13:03, Jürgen Exner <jurgenex@xxxxxxxxxxx> wrote:
markhobley@xxxxxxxxxxxxxxxxxxxxxxxxxxx (Mark Hobley) wrote:
In my professional perl programming guide, some of the examples put the
variable to be used as an iterator in void context before the loop. For
example:
$l;
for ($l = 0; $l < 10; $l++) {
print $l;
}
I am curious as to what reasons there are for doing this, because there
does not appear to be any mention of it anywhere within the book.
Of ocurse I don't know what the author was thinking. But _I_ would write
this as
for my $| (0..9) {
print $|;
}
I hope not.
Another question is why he would possibly want to assign 0 to 9 to the
autoflush variable.
A third question is why you use a font which apparently uses the same
glyph for the pipe symbol and the lower case ell.
hp
.
- References:
- Scalar variable in void context before a loop
- From: Mark Hobley
- Re: Scalar variable in void context before a loop
- From: Jürgen Exner
- Scalar variable in void context before a loop
- Prev by Date: Re: fork() & pipe()
- Next by Date: Re: Need help on AoH or array or any other think that might help!
- Previous by thread: Re: Scalar variable in void context before a loop
- Next by thread: Re: Scalar variable in void context before a loop
- Index(es):
Relevant Pages
|