You need to chomp the values for both variables before joining them into $fileType. Save the following code snippet to a file named example.pl:
#!/usr/bin/perl
use strict;
use warnings;
my $host = qx(hostname -s);
my $day = qx(date +%A);
chomp $host;
chomp $day;
my $fileType = "$host-$day.tgz";
print "$fileType\n";
I just beginner in this field. Once I get a better knowledge then it will be useful to provide a valid answer. Surely I’ll be active after that. I’m frequently following this forum. It was so helpful to me. Thank you