In article <miqrf7$hm5$
1...@news.m-online.net>,
I am an occasional user of "inplace". I think it is quite natty, in fact.
The behavior descibed above is not only "working as designed", but is a
feature. Think of it this way: Logically, the filename arguments in an AWK
program are out of scope in both BEGIN and END. They are only logically
accessible in the "main body" of the AWK program. Note: I say "logically"
because the exact implementation details are often a little bit messy, but
logically/conceptually, what I've stated is true. Now, since the "inplace"
feature is a function of the filename arugments (each is used, in turn, to
determine where the output goes), it therefore follows that the "inplace"
functionality is only active during the "main body" part of the AWK program.
P.S. Note also that you can sorta mess this up by doing a "naked" getline
in the BEGIN clause. This has the effect of starting up the "main input
loop" prematurely. I suspect (but have not tested) that doing so would
cause the "inplace" functionality to start working.
--
When people wish to comment on something on which they have personal
knowledge, but do not wish to convey the fact that it is personal
knowledge, they often qualify their statement with "it's my
understanding". For instance, it's my understanding that when some
women are depressed they sit on the futon in a Snuggie, watch Lifetime,
and eat a whole tub of Rocky Road ice cream.