Don't append new lines (\n) to the values of $webfile and $dbfile. use chomp on your $date variable. Note that This is not a portable (between Operating systems) way to get dates (see localtime).
#!/usr/bin/perl use strict; use warnings; my $date = `date +%Y%m%d`; chomp $date; my $tar = '.tar'; my $gz = '.gz'; my $dbfile = 'bugs_db_'.$date.$gz; my $webfile = 'bugzilla_'.$date.$tar.$gz; print "dbfile: $dbfile\n"; print "webfile: $webfile\n"; # since you want them in one line: print "$dbfile $webfile\n";
In reply to Re: Perl Variable Help.
by marto
in thread Perl Variable Help.
by arvindmarlabs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |