Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: What one-liners do people actually use?

by vek (Prior)
on Dec 08, 2005 at 19:52 UTC ( #515355=note: print w/ replies, xml ) Need Help??


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

Over the years I've found that I'm far too lazy to keep typing one liners so they usually end up as a tiny script in my $HOME/bin. I found myself typing the following one liner this week and because of its length, it immediately became $HOME/bin/sectostr.

perl -e 'use POSIX qw(strftime);print strftime("%H:%M:%S\n",974,0,0,0, +0,0);'

-- vek --


Comment on Re: What one-liners do people actually use?
Select or Download Code
Replies are listed 'Best First'.
Re^2: What one-liners do people actually use?
by Anonymous Monk on Dec 10, 2005 at 22:31 UTC
    Another way to write that:
    perl -e'printf "%3\$02d:%2\$02d:%1\$02d\n", gmtime 974' :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2015-07-31 06:32 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 (274 votes), past polls