http://www.perlmonks.org?node_id=134853


in reply to Supressing zero values in formatted reports

From the perlform manpage:
Picture fields that begin with ^ rather than @ are treated specially. With a # field, the field is blanked out if the value is undefined. For other field types, the caret enables a kind of fill mode.
So change your @#### to ^####, and make sure the values you want to suppress are undefined.

The second problem is that using an undefined value when warnings are enabled will generate several warning messages. I suggest disabling warnings within the format, like this:

{ no warnings; format STDOUT = @<<<<<<<<<<<<< ^#### @#####.## $output[$i], $output[$i+1], $output[$i+2]/1024 . }

Replies are listed 'Best First'.
Re: Supressing zero values in formatted reports
by ryan (Pilgrim) on Dec 28, 2001 at 15:50 UTC
    That works, thanks for that, I must try to search more for the answers for these things. I did a lot of searching in the wrong places :)
Re: Re: Supressing zero values in formatted reports
by Fengor (Pilgrim) on Dec 28, 2001 at 15:50 UTC
    hmm guess i should read more carefully next time ;-)

    thx
    fengor

    --
    "WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
    -- Terry Pratchett, "Reaper Man"