_ is a valid character in an identifier so Perl sees $profile_name_ as a variable name. To avoid the problem you can:
print "\n${profile_name}_$opt_$date\n";
Note the {} to delimit the variable name.
In reply to Re: Error while printing a variable
by GrandFather
in thread Error while printing a variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |