in reply to Re: Re: Using -i in oneliner with postprocessing
in thread Using -i in oneliner with postprocessing

The -p option wraps the script in a template equivalent to the following:

Yes, I knew that. I just never thought that "equivalent" extended to actual placement of braces and presumption of certain syntactic constructs to the extent used by this trick.

Speaking of which, is this (ab)use of -p blessed by p5p and/or Larry?

  • Comment on Re^3: Using -i in oneliner with postprocessing

Replies are listed 'Best First'.
Re: Re^3: Using -i in oneliner with postprocessing
by QM (Parson) on Apr 29, 2004 at 17:33 UTC
    is this (ab)use of -p blessed by p5p and/or Larry?
    I can't speak for them of course, but I would venture that it's allowed with the understanding that the -p "template" could change in the future in subtle ways that would break this type of "use".

    On the other hand, given the use of source filters such as Perligata and Lingua::tlhInganHol::yIghun (Klingon) (which unfortunately I can't find the actual module for), it seems that the Perl community would have an interest in making the language stable under these uses. [I'm sure I've made some gross error concerning source filters, but I'll just encourage the community to correct it here, and enlighten the rest of us.]

    Considering the simplicity and elegance of the template approach for -p and the like, I feel comfortable that that abuse is stable as well.

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