Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: string concatenation, which way is better?

by johngg (Abbot)
on Aug 08, 2012 at 22:09 UTC ( #986372=note: print w/ replies, xml ) Need Help??

in reply to string concatenation, which way is better?

You seem to be a little inconsistent with your variable names between the two code examples, $todayDate in one and $today_date in the other, so you may have a typo in your script. I don't know how you initialise your $todayDate variable. If you generate it programmatically in your code rather than reading it from a file you may find the strftime() function of the POSIX module along with localtime and time useful.

$ perl -MPOSIX=strftime -E ' > $file_dir = q{/var/log}; > say strftime qq{$file_dir/filename1.log.%F}, localtime( time() );' /var/log/filename1.log.2012-08-08 $

I hope this is helpful.



Comment on Re: string concatenation, which way is better?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2015-10-07 10:31 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (178 votes), past polls