sub g{$"--?map{g(":"x(!!$"-$"%4)."$_@_")}(0..9,a..f):print pop;$"++}$"=ord$";g$/
got it in 80 characters
it could be shorter but I wanted it obfuscated more than I wanted it short, and without eval-like tricks. Though I'm sure real Perl pros could make it both a lot less clearer and a lot shorter.
code challenge: write a program in the shape of a camel that prints “Just another Perl hacker”, and that by rearranging whitespace only to make it in the shape of a python, prints “Just another Python hacker”
@Gilles, i reckon most of my perl code is clearly written. i deliberately choose readability over almost every other criteria (except when performance is of utmost importance). otherwise, i know i'm going to come back in 6 months and wonder WTF i did
i just wrote a perl program for a perl newbie (never used it before, but experienced with sed and some awk) and he had no difficulty understanding it.
he had some questions in chat, about perl arrays and esp about $_ but pretty much guessed the answers anyway.
@FaheemMitha. I could. python's OK. except for the white-space thing, of course. i code in python when it seems appropriate (to fit in with an existing project, like openstack, for example)
it means used mostly by sysadmins, and/or well suited to the kinds of tasks that sysadmins need to write scripts or programs for.
i could go into more detail but a) as a sysadmin i'm likely to sound disparaging towards programmers (which was not my intent) and b) it's time to start getting ready for dialysis (i'm a part-time cyborg, need to plug in to scrub my blood every 2nd day)
@heemayl He probably just tried to post a question consisting of "how delete file?" and the system quality controls blocked him. That's fine, if the OP can't manage to type "delete file linux" into google, we don't really want them to be active here.
@FaheemMitha Compared to what? It's as fast as any other scripting language as far as I know.
@FaheemMitha Both of those are very fast actually. You just have to compare like with like. You're not used to scripting languages but comparing Perl and C in terms of speed is like saying a Ferrari is slow because a jet plane is faster.
I've had great success with combining Perl and embedded C code. I have the hardcore looping/number crunching done in C and all the regex and text parsing in Perl. Went from taking a week to run to taking a few hours.
@JeffSchaller Yes, I know, I had wondered that myself before becoming a mod. Turns out, the only way to flag users, as opposed to their posts, is to flag one of the posts and choose "other" and explain why you flagged.