http://qs321.pair.com?node_id=931934


in reply to Use scalars to define a filename

The underscore is a legitimate character in a variable name,so you'll have to create to the file in one of the following ways
my $fileName = "fileLocn/".$var1."_$var2.txt"; my $fileName = "fileLocn/${var1}_$var2.txt"; my $fileName = sprintf("fileLocn/%s_%s.txt", $var1, $var2);
Or one a a myriad others

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."