Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: backticks execution "inside" variable (string)

by eyepopslikeamosquito (Chancellor)
on Dec 17, 2019 at 07:19 UTC ( #11110266=note: print w/replies, xml ) Need Help??


in reply to backticks execution "inside" variable (string)

Not answering your more general question (which I don't understand), but note that you can easily generate a log file name with the current date/time in it with simple Perl. For example:

sub get_datestamp { my ($s, $m, $h, $d, $mon, $y) = localtime; sprintf('%02d%02d%04d', $d, $mon + 1, $y + 1900); } my $logfile = 'filename_' . get_datestamp() . '.log'; print "logfile='$logfile'\n";
This code works on any platform and has no need to interpolate bash command lines.

Replies are listed 'Best First'.
Re^2: backticks execution "inside" variable (string)
by Anonymous Monk on Dec 17, 2019 at 09:48 UTC
    That +1900 cargo cult is so last century

    use Time::Piece strftime

Re^2: backticks execution "inside" variable (string)
by richard.sharpe (Sexton) on Dec 20, 2019 at 13:36 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2020-05-27 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (152 votes). Check out past polls.

    Notices?