#!/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";