Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-11-26 15:32 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (701 votes), past polls