tmp = open('file','r').readlines()
for line in tmp:
iterationCount = iterationCount + 1
if regex.match('adfasdf',line) > 5
serverloop_code.insert(iterationCount,line) # line X
It would be nice if iterationCount were a pre-defined register like @i
or something so the code could be more compact . However, it would be
more cryptic to someone just getting into the language. Registers were
the main thing that made me quit learning Perl quickly.
Another way to look at this is that since Python is an object-oriented
language the for statement above is sending a message to `for' with 2
arguments. Since objects have their own private data, it would seem
that we could type serverloop_code.insert(for.current_pos(), line) at
line X to access some data in the `for' object.
What do you all think ?
-- terrence brannon email@example.com