Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: Short quines

by jdalbec (Deacon)
on Jan 12, 2008 at 15:36 UTC ( #662072=note: print w/replies, xml ) Need Help??

in reply to Re: Short quines
in thread Short quines

If you use <code> tags your quine becomes much simpler:
use strict; use LWP; use HTTP::Request; my $ua = LWP::UserAgent::new ('LWP::UserAgent'); LWP::UserAgent::agent ($ua, 'Mozilla/5.0'); my $url = ";node_id=6 +62072"; my $request = HTTP::Request::new ('HTTP::Request', GET => $url); my $response = LWP::UserAgent::request ($ua, $request); print $response->content;
Also, you don't break formatting for replies to your node.

Edit: I think you want a question mark after dot-star. Otherwise it's q-positively trivial for me to break your code.

Edit2: I just realized that, if you put a question mark after dot-star, the end of your regex matches itself. But there are ways around that.

Replies are listed 'Best First'.
Re^3: Short quines
by ambrus (Abbot) on Jan 12, 2008 at 18:26 UTC

    As the title of this thread is "short quines", let me shorten that code a bit.

    use LWP::Simple;getprint""

    Update: fixed code. It should now work.

    Update 2012-05-24:</c> see also Usually J.A.P.H..

Re^3: Short quines
by Snarius (Sexton) on Jan 12, 2008 at 19:21 UTC
    I tried using <code. It renders > as & gt; or something. I actually tried to eliminate the >'s from my code, which is why there are lines like LWP::UserAgent::request ($ua, $request); instead of $ua->request ($request);.

      I'm quite sure that the displaytype=displaycode cgi argument makes perlmonks return the code as plain text, not HTML, so the angle brackets shouldn't be a problem.

      Let me try.

      use warnings; use strict; my $u = ";displaytype=displaycode" +; use LWP; print LWP::UserAgent->new->get($u)->content;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://662072]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2018-01-18 23:50 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (215 votes). Check out past polls.