Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

an obfuscated closure

by Maestro_007 (Hermit)
on Jun 19, 2001 at 21:02 UTC ( #89718=obfuscated: print w/replies, xml ) Need Help??

The actual string stuff here is pretty basic. I just don't see closures in japh's often enough.
#!/usr/local/bin/perl use strict;sub mm{my $p=(q+1249211252m+.q-541159023a-. q*1952998770r*.q!542139762c!.q^1814055009u^.q/1667982706s/); return sub{pack(shift,split(/[a-z]/,$p))}}my$q=mm;print $q->("l*");
Added 6/21

Quiz:Anyone want to guess what my first name is? Shouldn't be too tough...

Replies are listed 'Best First'.
Re: an obfuscated closure
by Abigail (Deacon) on Jun 20, 2001 at 04:45 UTC
    You don't see closures enough? Well, here's a closure for you. A closure with one variable from an outside scope: itself. (You need to allow code to be at least 77 columns wide to benefit optimally from the formatting)
    $_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; +$chop}; $chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ( +) -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ( +) -> ()

    -- Abigail

      A response from Abigail! I've been following your japh's for months! This was my first attempt at a japh, based on the very one you've quoted, along with a few others. Sure, I have seen closures in japh's, just not as often as other things. I guess I just really like closures...
Re: an obfuscated closure
by premchai21 (Curate) on Jun 19, 2001 at 21:42 UTC
    Closures stay in the context in which they were created. That's one of the ways in which they are useful; for instance, one can use a closure to create private variables. This is standard behavior.
Re: an obfuscated closure
by iamcal (Friar) on Jun 20, 2001 at 12:15 UTC
    Yesterday's Chop Chop was a double use of closure

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2023-01-29 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?