phamalda has asked for the wisdom of the Perl Monks concerning the following question:
I have a filename that is formatted as electric_inventory_WE_20170730_195758.dat. There is a similar file created each day. The time created may vary. I need to capture the filename with today's date and not worry about the time and end with a .dat extension.
I have created a variable for today's date. I need to use this variable inside a string inside back ticks. Something like this:
my $today = `date "+%Y%m%d"`;
my $filename = `ls electric_inventory_WE_$today*.dat`;
I did review #828922 but it didn't quite get me what I needed. I cannot find a way to get this variable to work inside a string inside the back ticks. Any help would be greatly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: variable inside a string inside back ticks
by haukex (Archbishop) on Jul 30, 2017 at 16:12 UTC | |
Re: variable inside a string inside back ticks
by Discipulus (Canon) on Jul 30, 2017 at 16:16 UTC | |
by Anonymous Monk on Jul 30, 2017 at 16:48 UTC | |
Re: variable inside a string inside back ticks
by Anonymous Monk on Jul 30, 2017 at 16:22 UTC | |
Re: variable inside a string inside back ticks
by Anonymous Monk on Jul 31, 2017 at 13:33 UTC |