Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: output format changed perl5.8 --> perl 5.10?

by fishmonger (Chaplain)
perl 5.10? NODE.owner = 626694 N.title = monktitlebar sitedoclet N.owner = 17342 -->
on Apr 25, 2014 at 16:33 UTC ( #1083809=note: print w/replies, xml ) Need Help??


in reply to output format changed perl5.8 --> perl 5.10?

Do you really need each component of the timestamp in individual vars? Are they being used elsewhere or are they just being used to build up your tstamp and dstamp strings?

IMO, it would be much cleaner and easier to use the strftime function from the POSIX module.

#!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); my $dstamp = strftime("%Y%m%d", localtime(time)); my $tstamp = strftime("%H%M%S", localtime(time)); print "tstamp is $tstamp\n"; print "dstamp is $dstamp\n";

Which outputs this format:

tstamp is 092141
dstamp is 20140425

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1083809]
help
Chatterbox?
[marto]: meh, the admins are lazy, I just piped null to some old large log files, problem solved
[Corion]: marto: Heh ;) You're just further enabling their lazyness :-D
[marto]: they still don't know there was a problem, nobody told them! :P

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-01-24 10:04 GMT
Sections?
perl 5.10? NODE.owner = 626694 N.title = Sections sitedoclet N.owner = 17342 -->
Information?
perl 5.10? NODE.owner = 626694 N.title = Information sitedoclet N.owner = 17342 -->
Find Nodes?
perl 5.10? NODE.owner = 626694 N.title = Find Nodes sitedoclet N.owner = 17342 -->
Leftovers?
    perl 5.10? NODE.owner = 626694 N.title = Leftovers sitedoclet N.owner = 17342 -->
    Voting Booth?
    Do you watch meteor showers?




    Results (203 votes). Check out past polls.