http://qs1969.pair.com?node_id=11137668


in reply to OS agnostic C&P CLI snippets with -E

Question: Is there a shorter way to do this?

Sure. Write your one liner, then post the output of -MO=Deparse

  • Comment on Re: OS agnostic C&P CLI snippets with -E

Replies are listed 'Best First'.
Re^2: OS agnostic C&P CLI snippets with -E
by bliako (Monsignor) on Oct 18, 2021 at 16:42 UTC

    how does that help?

      bliako: how does that help?

      puzzling. how does it not help?

      question was portable oneliners, Is there a shorter way to do this?

      yeah, enjoy your one liner, then let deparse write the portability version you share

      files are good

        Nobody needs Deparse here

        $ perl -e'print "drivel";#some code' drivel

        --->

        BASH:

        $ perl print "drivel";#some code __END__ drivel

        and CMD

        D:\tmp\pm>perl print "drivel";#some code __END__ drivel D:\tmp\pm>

        EDIT

        And using Deparse to cover -E is producing a ridiculous amount of code

        $ perl -MO=Deparse -E'print "drivel";#some code' use feature 'current_sub', 'evalbytes', 'fc', 'postderef_qq', 'say', ' +state', 'switch', 'unicode_strings', 'unicode_eval'; print 'drivel'; -e syntax OK

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery