j--a has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks,

Is there a module or standard program which translates scripts/programs/files into one-liner formats?

Replies are listed 'Best First'.
Re: translate to one-liner
by wrog (Friar) on May 25, 2015 at 00:45 UTC
    No.


    (I suppose it might not actually be that hard to write something that would remove all of the newlines from a script, dealing with heredocs and tossing podstuff and comments correctly, but .... why?)

      although handling implicit looping over contents of files passed on the command line and print etc may be a little more challenging, but as you say, "Why"?

      Perl is the programming world's equivalent of English

        Apologies Monks.

        I should have elaborated, this was/is not by any means critical. There is no need, just my own esoteric curiosity. I've been playing around with 'the problem' for a bit now and wondering if it was a thing which had already been handled. Every search gave results for the converse situation of turning a one-liner into a program, thus my desire to get more insight.

        Thank you for your attention.

Re: translate to one-liner
by AnomalousMonk (Archbishop) on May 25, 2015 at 04:44 UTC

    j--a: I share the puzzlement of wrog and GrandFather as to why one would need something like this. Can you say a bit more about why you would want this? What need would this fulfill for you?


    Give a man a fish:  <%-(-(-(-<