Do you know where your variables are? | |
PerlMonks |
variable inside a string inside back ticksby phamalda (Novice) |
on Jul 30, 2017 at 16:01 UTC ( [id://1196310]=perlquestion: print w/replies, xml ) | Need Help?? |
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.
Back to
Seekers of Perl Wisdom
|
|