mt35 <> wrote:
> 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:
^^^^^^^^
There IS NO bareword anywhere in your code...
A bareword is a word that is not quoted, that is what makes it "bare".
> my $date = `date "+%m%d%Y"`;
Try adding a debugging print() statement here:
print "date is [$date]\n";
> $tar->write ("$date test.tar");
^^^^^^^^
^^^^^^^^ it is in quotes, so it is not "bare"
> However the file written is: 09292004?.snort.tar.gz
How did it become "snort.tar" instead of "test.tar"?
Where did the dot before the "snort" come from?
What happened to the space that you put into the filename?
Is this truly what your filename looks like?
If so, then you haven't shown us your real code.
If not, then how are we supposed to give an accurate answer
when given inaccurate symptoms?
Have you seen the Posting Guidelines that are posted here frequently?
> My question is why is the question mark being written?
First, there is no question mark being written. I expect *your shell*
is using question mark to represent a newline character?
Second, the question mark is probably actually a newline character,
chomp() it off if you do not want it there.
--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas