Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

translate to one-liner

by j--a (Novice)
on May 25, 2015 at 00:14 UTC ( [id://1127630]=perlquestion: print w/replies, xml ) Need Help??

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:  <%-(-(-(-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1127630]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found