You didn't show us any code that might give us some indication as to what you're doing wrong. You should post somewhere less than ten lines of code (in this case) that mimicks the problem. (10 is an arbitrary number, but for such a simple problem is probably sufficient).
If you want me to guess, I'll say your problem is that you are accepting the number of days as input, and forgetting to chomp that input. When the user types "1<enter>", that is captured into the recipient variable as "1\n" (in other words, enter is preserved as a \n (newline) character). chomp the input and the problem will go away, if my guess as to what you are doing wrong is correct.
As for figuring out how to print all that:
print "[$days] day", ($days != 1) ? 's' : '', ' = [', $days * 24 * 60 * 60, "] seconds.\n";
...should do the trick.
Dave
In reply to Re: Formatting in Perl
by davido
in thread Formatting in Perl
by Ms. T.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |