in reply to All in one
Why are people always trying to accomplish things "all in one statement"
I find myself doing this with some frequency, though usually I don't go so far as to ask someone else for help doing it. I think one of the main reasons I like to reduce multiple statements into one is, well, because I can. It's a diversion, something to do while you figure out how that next function (or whatever) is going to work. It's a little like playing Perl golf, but it's less work.
Sometimes readability is enhanced by reducing the number of statements, especially in cases where it lets you cut out some temporary variables. Other times, you can go too far and actively harm readability, at which point sensible people should back off and leave it as two or more statements, unless what you're coding is an obfu or japh.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|
|---|