Comments on: Stupid perl tricks (that would be better in something else) http://www.imaginarybillboards.com/?p=56 Imagined things Thu, 28 Jan 2010 02:11:03 +0000 hourly 1 https://wordpress.org/?v=6.0.9 By: admin http://www.imaginarybillboards.com/?p=56&cpage=1#comment-9 Fri, 21 Aug 2009 15:44:29 +0000 http://www.imaginarybillboards.com/?p=56#comment-9 I think that is prettier. When you’re dealing with a bunch of python guys, that’s suprisingly important. Thanks all!

]]>
By: Matt S Trout http://www.imaginarybillboards.com/?p=56&cpage=1#comment-8 Fri, 21 Aug 2009 12:46:34 +0000 http://www.imaginarybillboards.com/?p=56#comment-8 Meh.

perl -e ‘print q{echo “}.join(“\n”,map “repair table $_;” @ARGV).q{“| mysql -uroot mydvb};’ things whosit mrmr

is longer, but prints prettier shell commands.

When generating code, always try and make the generated code pretty, even at the cost of a little more ugliness in the generator – you’ll thank yourself when you have to debug the output.

(and yes, I know everybody else was just playing, but this still strikes me as a more elegant solution 🙂

]]>
By: Chas. Owens http://www.imaginarybillboards.com/?p=56&cpage=1#comment-7 Thu, 20 Aug 2009 23:13:24 +0000 http://www.imaginarybillboards.com/?p=56#comment-7 Shaved another two characters off:

perl -le ‘map{print$c=”echo repair table $_ | mysql -uroot mydb”;`$c`}@ARGV’ things whosit mrmr

]]>
By: Chas. Owens http://www.imaginarybillboards.com/?p=56&cpage=1#comment-6 Thu, 20 Aug 2009 23:11:09 +0000 http://www.imaginarybillboards.com/?p=56#comment-6 I can’t help but golf this:

perl -le ‘for(@ARGV){print$c=”echo repair table $_ | mysql -uroot mydb”;`$c`}’ things whosit mrmr

]]>