On Jun 1, David Gilden said:

>$sort_order =0;
>
>$sort_type = ($sort_order) ? 'Newest First' : 'Oldest First';
># are the () optional?

In this case, yes, you don't need those parens.

>print ($sort_order) ? 'Newest First' : 'Oldest First';

Remove the parens, or add them around the entire argument list to print:

  print( ($sort_order) ? '...' : '...' );


>----printf question--
>how do I use print to provide a leading '0' to $min, such that
>I get 5:01 and not 5:1

You want to use printf() or sprintf():

  printf "%d:%02d\n",   5, 1;  # "5:01";
  printf "%02d:%02d\n", 5, 1;  # "05:01";

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to