WalaWiki content from p1k3.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

18 lines
590 B

WareLogging, LearningPerl.
<[[Brennen]]> Sad as this is to admit, I always forget what a Perl for-loop is supposed to look like, probably since I mostly just use "foreach" to iterate over lists.
Anyway, it goes like this:
for ($i=1; $i < 100; $i++) {
# ^init ^while ^increment or whatever
print "Number $i\n";
}
<[[alan]]> if mem usage doesn't matter you can always just do
for my $i (1..99) {
...
}
but then again, if you meet a C programmer on the street and you don't remember the first form, he may just punch you in the nuts. that could be bad.