No, they work the same. It's the rest of the code that works differently, insofar as it's not inside an implicit loop any more. BEGIN and END don't care whether they're inside a loop or not, which is why they "degenerate" to the case of awk and sed when they are in an implicit loop.