M
mt35
Hi,
I'm trying to write a file name using a predefined scalar (my $date =
`date "+%m%d%Y"`) and a bareword (snort.tar). Here's the code:
#----------Start Code Block------------
#!/usr/bin/perl
use strict;
use Archive::Tar;
my $tar = Archive::Tar->new;
my $date = `date "+%m%d%Y"`;
chdir "/home/user/perl" or die "$!";
my @tarlst = ("test0", "test1");
$tar->add_files(@tarlst);
$tar->write ("$date test.tar");
#--------End Code Block--------------
However the file written is: 09292004?.snort.tar.gz
My question is why is the question mark being written?...If I add a
"print $date" it comes out fine.
Thanks for your time.
I'm trying to write a file name using a predefined scalar (my $date =
`date "+%m%d%Y"`) and a bareword (snort.tar). Here's the code:
#----------Start Code Block------------
#!/usr/bin/perl
use strict;
use Archive::Tar;
my $tar = Archive::Tar->new;
my $date = `date "+%m%d%Y"`;
chdir "/home/user/perl" or die "$!";
my @tarlst = ("test0", "test1");
$tar->add_files(@tarlst);
$tar->write ("$date test.tar");
#--------End Code Block--------------
However the file written is: 09292004?.snort.tar.gz
My question is why is the question mark being written?...If I add a
"print $date" it comes out fine.
Thanks for your time.