Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

I give... where does the 1 come from?

by jonadab (Parson)
on Apr 17, 2003 at 02:31 UTC ( [id://251106]=note: print w/replies, xml ) Need Help??


in reply to The Most Cleverly Hidden Secret of All Time! (666th post)

Okay, two questions: first, why does ${chr(23)} evaluate to 1 and second, how in the name of all that is sane did you discover this gem of trivia?


for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}

Replies are listed 'Best First'.
Re: I give... where does the 1 come from?
by pfaut (Priest) on Apr 17, 2003 at 02:42 UTC

    ${chr(23)} = $^W. Same as $foo = ${foo}.

    90% of every Perl application is already written.
    dragonchild

      D'oh. I theoretically should have known that, I just forgot about the way unix handles bucky bits. (I come from the DOS world, where holding Ctrl causes the Ctrl bit to be set in the KSB, and pressing W causes the character W to be sent on hardware interrupt 9, and it is also possible to type in character 23 (Alt+023 on the keypad), which is different and will usually have a different effect. I've been using Linux for a while now, but I haven't done any lowlevel assembly-language stuff, so I only occasionally brush into this, and it hasn't firmly taken root in my brain yet.)


      for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 03:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found