Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: backticks execution "inside" variable (string)

by eyepopslikeamosquito (Archbishop)
on Dec 17, 2019 at 07:19 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11110266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found