in reply to Formatting in Perl

davido is right in all respects, though I would handle the plural a little differently (for clarity, I think):
chomp $number_of_days; # assuming this came from <STDIN> my $plural = ( $number_of_days == 1 ) ? '' : 's'; print "\[$number_of_days\] day$plural = \[$number_of_sec\] seconds.\n +";

Replies are listed 'Best First'.
Re^2: Formatting in Perl
by tachyon (Chancellor) on Oct 01, 2004 at 03:34 UTC

    You don't need to escape the [ ]. If you want to use a name for the plural suffix $s is quite readable and self documenting :-)

    print "[$days] day$s = [$secs] seconds.\n";