Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: How do I remove newline character from a number got from unix command

by Tux (Canon)
on Sep 04, 2013 at 12:37 UTC ( [id://1052326]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I remove newline character from a number got from unix command
in thread How do I remove newline character from a number got from unix command

my $date_as_YYYY_MM_DD = do { my @d = localtime; sprintf "%04d-%02d-%02d", $d[5] + 1900, ++$d[4], $d[3]; };

but that is most likely better done with POSIX' strftime:

use POSIX qw( strftime ); my $d_YMD = POSIX::strftime ("%Y-%m-%d", localtime); my $d_Md = POSIX::strftime ("%d %b", localtime); # I prefer 04 Sep ov +er Sep 04

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: How do I remove newline character from a number got from unix command
by tousifp (Novice) on Sep 04, 2013 at 15:45 UTC
    t a n k s!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (9)
As of 2024-04-24 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found