Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: What one-liners do people actually use?

by contradev (Monk)
on Dec 09, 2005 at 09:27 UTC ( #515493=note: print w/ replies, xml ) Need Help??


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

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

:)


Comment on Re: What one-liners do people actually use?
Download Code
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"'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2015-07-07 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls