develooper Front page | perl.perl5.porters | Postings from March 2019

[perl #133961] Documentation patch for -M

Philippe 'BooK' Bruhat
March 28, 2019 04:42
[perl #133961] Documentation patch for -M
Message ID:
# New Ticket Created by  Philippe 'BooK' Bruhat 
# Please include the string:  [perl #133961]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Here's a tiny documentation patch for -M.

I found this while and reading `perlrun` and exploring the possibilities
of `-M5;some-code` as a way to insert code before the loop when used in
combination with -n and -p (

    $ perl -MO=Deparse '-M5;insert_code_here()' -pe 1
    sub BEGIN {
        require 5;
    LINE: while (defined($_ = readline ARGV)) {
    continue {
        die "-p destination: $!\n" unless print $_;
    -e syntax OK

Feel free to reword it as needed.

 Philippe Bruhat (BooK)

 Destroy the little and you destroy the large.
                                    (Moral from Groo The Wanderer #55 (Epic)) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About