Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Impress your children with Perl

by Anonymous Monk
on May 21, 2024 at 08:46 UTC ( [id://11159584]=CUFP: print w/replies, xml ) Need Help??

Every child in America, and several other countries, have access to an Apple Mac. Tell them to open Finder, then open Applications, then open Utilites, then open Terminal and type this:
perl -MHTTP::Tiny -e 'eval HTTP::Tiny->new->get(shift)->{content}' htt +ps://www.perlmonks.org/?node_id=176043;displaytype=displaycode
Hit return and wow kid genius you just wrote a computer program that downloads another program that runs and looks super cool! What else can this thing do? Type: perldoc perlintro

(tinyurl.com/spiraling-quine links the source of the amazing spiraling quine)

Replies are listed 'Best First'.
Re: Impress your children with Perl
by Anonymous Monk on May 21, 2024 at 13:31 UTC
    tinyurl.com/spiraling-quine links the source

    sure, right up until it doesn't anymore and I eval random source from the internet

Re: Impress your children with Perl
by marto (Cardinal) on May 21, 2024 at 09:52 UTC

    "Every child in America, and several other countries, have access to an Apple Mac."

    How?

        How is a tinyurl safer than giving the explicit URL? At least with an explicit URL you immediately have a provenance. A tinyurl link could go anywhere.

        While the code fiddling issues are concerning, they aren't altered by how the code is accessed so are irrelevant when considering replacing the tinyurl with an explicit URL.

        Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
        >> "Every child in America, and several other countries, have access to an Apple Mac."

        > How?

      We are really RICH! Apple has a chunk of the education market. Research shows students prefer Apple devices. Apple carpet bombs the country with about 20,000,000 copies of Perl per year (now up to 40 million: Why does Apple Mac ship with TWO versions of Perl??). They are everywhere. Perl is EVERYWHERE!

Re: Impress your children with Perl
by cavac (Prior) on May 22, 2024 at 04:10 UTC
      IOS is a very walled garden, which seems like a fine idea--for the kind of people who fingerpaint on half a computer. macOS defaults to a similar situation with its apps and app store, but once a terminal is open you are in a certified Unix 3 environment. Homebrew and macports provide tons of unix and linux software. Lulu is a must for precise control of Apple telemetry. Run Linux in a window with UTM. IOS can run Linux too.

        IOS is a very walled garden, which seems like a fine idea--for the kind of people who fingerpaint on half a computer.

        Hope you don't mind i steal that quote :-)

        PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
Re: Impress your children with Perl
by Anonymous Monk on May 21, 2024 at 19:14 UTC
      zsh: no matches found: https://www.perlmonks.com/index.pl?displaytype= +displaycode

      I'm not sure this would impress my children. Maybe because we're not in the US?

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
        > zsh: no matches found

        I don't know why that would happen because when pasted into my zsh on macos all these slashes magically appear:

        perl -MHTTP::Tiny -e 'eval HTTP::Tiny->new->get(shift)->{content}' htt +ps://www.perlmonks.com/index.pl\?displaytype\=displaycode\;abspart\=1 +\;node_id\=574225\;part\=1

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://11159584]
Approved by sflitman
Front-paged by sflitman
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2025-06-14 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.