in reply to Re: BEGIN and END with -p or -n
in thread BEGIN and END with -p or -n

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.

Replies are listed 'Best First'.
Re^3: BEGIN and END with -p or -n
by QM (Parson) on Dec 02, 2005 at 04:28 UTC
    So it seems that the statement in perlmod is extraneous, and should be cut, as BEGIN and END do what they do, regardless.

    There's no reason to mention awk, or imply a different behavior under -p or -n.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of