in reply to Perl Variable Help.
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Variable Help.
by Dumu (Monk) on Jul 02, 2015 at 11:36 UTC |