in reply to Re: Delete a line from files
in thread Delete a line from files

what is the purpose of the BEGIN blocks?

Replies are listed 'Best First'.
Re^3: Delete a line from files
by karlgoethebier (Abbot) on Oct 12, 2015 at 11:38 UTC
    "...the purpose of the BEGIN blocks?"

    Begin to read?

    Update: Slight losses are usual in every combat.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      I meant why set $^I and $^/ at compile time with Begin?
        These are documented in perlvar
        • for $^I search perlvar for "inplace". This has to be prepared before opening the file
        • $/ (without caret), if you use English, you can call it $INPUT_RECORD_SEPARATOR - should be set before the first read operation
        Update: the BEGIN block is necessary so that these assignments are executed before the implicit loop by the -p flag, see perlrun