http://qs1969.pair.com?node_id=515493


in reply to What one-liners do people actually use?

perl -le 'print `date`=~/Fri/ ? "woohoo" : "boohoo"'

:)

Replies are listed 'Best First'.
shortest one liner
by hakkr (Chaplain) on Dec 09, 2005 at 10:57 UTC
    perl -v
    Other than that the only one I use is search and replace.
    perl -pi -e 's/somestring/otherstring/g' *.htm

    cut, grep, xargs and find ususally do instead

Re^2: What one-liners do people actually use?
by Anonymous Monk on Dec 10, 2005 at 21:51 UTC
    Why not just use localtime?
    perl -le'print localtime =~ /Fri/ ? "w" : "b", "oohoo"'
    Or:
    perl -le'print 5 == (localtime)[6] ? "w" : "b", "oohoo"'