Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

(bbq) RE: Evolution of an Obfuscated Throwaway Script

by BBQ (Deacon)
on Oct 06, 2000 at 08:02 UTC ( #35541=note: print w/replies, xml ) Need Help??

in reply to Evolution of an Obfuscated Throwaway Script

Okay, so this is really NOT obfuscated, but it is a one liner!
# 1st shot df -h | perl -e '@i = <>;s/(\ +)/\,/g && print for @i[1..@i];' > the.c +sv # 2nd shot df -h | perl -e '/^\w/&&next||s/\ +/\,/g&print for<>' > the.csv
I kinda like the look, but merlyn has already pointed out that s/// for is bad. :)

# Trust no1!

Replies are listed 'Best First'.
RE: (bbq) RE: Evolution of an Obfuscated Throwaway Script
by DrManhattan (Chaplain) on Oct 14, 2000 at 01:58 UTC
    df -h | perl -lpe 's/\s+/,/g' > the.csv

    Sorry, I know it's supposed to be obfuscated, but I can't resist the urge to golf. :)


      I would definitly stand up and clap if it weren't for one small detail. The first line in this case would read:

      Yeah, I know... I'm being a picky sore looser! :)

      # Trust no1!
RE: (bbq) RE: Evolution of an Obfuscated Throwaway Script
by mischief (Hermit) on Oct 16, 2000 at 13:39 UTC
    where did merlyn point out that the s/// for is bad? why is this?
      Yeah, just where did I point out that that was bad?

      And remember, I have different rules for Obfuscated vs. Golf vs. Bowling vs. 10-minute hacks vs. actual code that a customer paid for vs. training materials. Don't paint me with a broad sword there, or something like that.

      -- Randal L. Schwartz, Perl hacker

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2022-12-01 07:24 GMT
Find Nodes?
    Voting Booth?