Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Do the dishes

by satchboost (Scribe)
on Apr 04, 2001 at 02:23 UTC ( [id://69498]=note: print w/replies, xml ) Need Help??


in reply to Do the dishes

I am in awe. I spent the entire afternoon figuring this one out and all I can say is "Wow".

I do have a few questions, if you don't mind.

1) I understand that

0123 =~ m #\d+# $8.$;

is a NO-OP. I just don't understand how. I'm also assuming that the eval() right afterwards puts a semi-colon in right before, but I'm not sure why.

2) How on earth did you get the crypt function to work the way you wanted it to?? Was it just random luck or did you brute force a whole bunch of possibilities until you got the ones you wanted?

3) Why did you have to quote the No Using Deparse tr when using 'y'? Once I got it into tr///, it worked just fine, but leaving it in y/// didn't.

If I could ++ this again, I would. I learned a ton from it. Thank you!

Replies are listed 'Best First'.
(tye)Re3: Do the dishes
by tye (Sage) on Apr 07, 2001 at 20:58 UTC

    First, I don't mind at all and I'm sorry for the long time it took me to respond.

    1) Actually that is vital for preventing a warning. And you've parsed it incorrectly (which is why you are confused about the semicolon). I knew I didn't do nearly enough with that construct when I found it!

    You see, I tried to use quite a few things that I didn't know before-hand how they would parse and that I was pretty sure I couldn't look up (Perl has quite a few of these). Those two lines are one of the best examples of that and I'm reluctant to just spill the beans on it as I hope to use it again in future. (: Besides, with just a bit of experimentation, anyone should be able to figure out what is going on.

    2) I wrote a Perl script to find those, of course (by brute force). Most of them took nearly no time since I only had to get about two characters to match. In fact, I had the script find the first 10 cases that work either with or without the salt prepended to the "password":

    print join " ",crypt("Ju-T","Ju"), crypt("-~","Ju") # produces: JustlAveUo0gg JustT9svpIBa.
    but the "password" for "another" took quite a while to calculate.

    3) I didn't understand this so I asked for clarification and got

    satchboost says when I took the '=> ...' out from y No ...N => ..., it wouldn't run. When I changed the 'y' to 'tr', it worked just fine. Why?
    You can take out the => if you replace it with a comma (or probably even a semicolon). The quoting nature of => isn't needed but you have to separate that expression (or statement) from the next. I can only assume that when you changed it to 'tr' you also did something to separate the expressions. But if not, show me the two cases and I'll be happy to help you figure it out.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

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

    No recent polls found