Hi guys, I'm having issues getting the following snippet of my script to work and was hoping for some suggestions.
I'm trying to pass a variable in perl system with wget.
This is what I need help with:
#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw(strftime) ;
my $TimeStamp=strftime "%Y%m%d",localtime ;
system('wget -q --no-check-certificate -O /tmp/DataFile_$TimeStamp "https://foobar.com/html"') ;
I can't get the $TimeStamp to interpolate into the system command.
There's more than one way to do it, in Perl.
The dot (".") is the string concatenation operator.
#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw(strftime) ;
my $TimeStamp=strftime "%Y%m%d",localtime ;
system('wget -q --no-check-certificate -O /tmp/DataFile_'.$TimeStamp.' "https://foobar.com/html"') ;